Geoserver - OG C Функции API - Определение API - PullRequest
0 голосов
/ 25 февраля 2020

Я использую geoserver-2.16.x-2020-02-19-war в сочетании с соответствующим модулем API OG C.

Я использую файлы Shape в качестве базы данных, и все работает нормально.

В документе определения API я нахожу определение пути:

/collections/{collectionId}:
get:
  tags:
  - Capabilities
  summary: describe the feature collection with id `collectionId`
  operationId: describeCollection
  parameters:
  - $ref: '#/components/parameters/collectionId'
  - $ref: '#/components/parameters/otherParameters'
  responses:
    "200":
      content:
        application/x-yaml:
          schema:
            type: string
            format: binary
        application/json:
          schema:
            type: string
            format: binary
        application/cbor:
          schema:
            type: string
            format: binary
        text/html:
          schema:
            type: string
      $ref: '#/components/responses/Collection' 

Ссылка $ ref ('# / components / response / Collection') содержит следующую информацию:

content:
    application/json:
      schema:
        $ref: '#/components/schemas/collection'
      example:
        id: buildings
        title: Buildings
        description: Buildings in the city of Bonn.
        extent:
          spatial:
            bbox:
            - - 7.01
              - 50.63
              - 7.22
              - 50.78
          temporal:
            interval:
            - - 2010-02-15T12:34:56Z
              - null
        links:
        - href: http://data.example.org/collections/buildings/items
          rel: items
          type: application/geo+json
          title: Buildings
        - href: http://data.example.org/collections/buildings/items.html
          rel: items
          type: text/html
          title: Buildings
        - href: https://creativecommons.org/publicdomain/zero/1.0/
          rel: license
          type: text/html
          title: CC0-1.0
        - href: https://creativecommons.org/publicdomain/zero/1.0/rdf
          rel: license
          type: application/rdf+xml
          title: CC0-1.0
    text/html:
      schema:
        type: string

Теперь мой первый вопрос: почему существуют разные типы мультимедиа-ответов, указанные в '# / components / response / Collection / content' и '# / paths / collection / {collectionId} / get / response / 200 / content 'и как они связаны?

Мой второй вопрос:

Я могу запросить любой соответствующий документ / collection / {collectionId} с URL-адресами :

.../collections/{collectionId}?f=text/html
.../collections/{collectionId}?f=application/json
.../collections/{collectionId}?f=application/cbor
.../collections/{collectionId}?f=application/x-yaml

Почему это возможно, хотя соответствующий параметр 'f' не определен в каталоге / collection / {collectionId} / get / parameters?

Примечание. Я прочитал спецификацию Swagger OpenAPI. Но я не смог найти ответов на эти вопросы.

Большое спасибо за вашу помощь.

...