0

我将 geoserver-2.16.x-2020-02-19-war 与相应的 OGC API 模块结合使用。

我使用 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/responses/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/responses/Collection/content' 和 '#/paths/collections/{collectionId}/get/responses/200/content' 中指定了不同的响应媒体类型,它们的关系是什么?

我的第二个问题:

我可以使用以下 URL 请求任何相应的 /collections/{collectionId} 文档:

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

为什么在 /collections/{collectionId}/get/parameters 下没有定义相应的参数“f”?

注意:我阅读了 Swagger OpenAPI 规范。但我无法找到这些问题的任何答案。

非常感谢您的帮助。

4

0 回答 0