This is an automated email from the ASF dual-hosted git repository. bchapuis pushed a commit to branch 629-ogcapi in repository https://gitbox.apache.org/repos/asf/incubator-baremaps.git
commit 19579321fb8fa59e91eda3f2c11b67a380b92731 Author: Bertil Chapuis <[email protected]> AuthorDate: Tue Apr 25 15:25:10 2023 +0200 Update the OGC API specification files --- .../baremaps/ogcapi/CollectionsResource.java | 2 +- .../src/main/resources/schemas/collection.yaml | 33 +++++++++------------- .../src/main/resources/schemas/collections.yaml | 13 +++++++-- .../src/main/resources/schemas/exception.yaml | 14 +++++++-- .../src/main/resources/schemas/landingPage.yaml | 10 +++++-- .../src/main/resources/schemas/link.yaml | 13 +++++++++ pom.xml | 2 +- 7 files changed, 59 insertions(+), 28 deletions(-) diff --git a/baremaps-ogcapi/src/main/java/org/apache/baremaps/ogcapi/CollectionsResource.java b/baremaps-ogcapi/src/main/java/org/apache/baremaps/ogcapi/CollectionsResource.java index 575ffd5d..ac11951d 100644 --- a/baremaps-ogcapi/src/main/java/org/apache/baremaps/ogcapi/CollectionsResource.java +++ b/baremaps-ogcapi/src/main/java/org/apache/baremaps/ogcapi/CollectionsResource.java @@ -48,7 +48,7 @@ public class CollectionsResource implements CollectionsApi { @Override public Response addCollection(Collection collection) { - collection.setId(UUID.randomUUID()); + collection.setId(UUID.randomUUID().toString()); jdbi.useHandle(handle -> handle .createUpdate("insert into collections (id, collection) values (:id, :collection)") .bind("id", collection.getId()).bindByType("collection", collection, COLLECTION).execute()); diff --git a/baremaps-ogcapi/src/main/resources/schemas/collection.yaml b/baremaps-ogcapi/src/main/resources/schemas/collection.yaml index c3e0a04c..0cf1c3ef 100644 --- a/baremaps-ogcapi/src/main/resources/schemas/collection.yaml +++ b/baremaps-ogcapi/src/main/resources/schemas/collection.yaml @@ -4,29 +4,35 @@ required: - links properties: id: + description: identifier of the collection used, for example, in URIs type: string - format: uuid example: address title: + description: human readable title of the collection type: string example: address description: + description: a description of the features in the collection type: string - example: An address - attribution: - type: string - title: attribution for the collection + example: An address. links: type: array items: $ref: link.yaml + example: + - href: http://data.example.com/buildings + rel: item + - href: http://example.com/concepts/buildings.html + rel: describedby + type: text/html extent: $ref: extent.yaml itemType: - description: An indicator about the type of the items in the collection + description: indicator about the type of the items in the collection (the default value is 'feature'). type: string + default: feature crs: - description: the list of coordinate reference systems supported by the API; the first item is the default coordinate reference system + description: the list of coordinate reference systems supported by the service type: array items: type: string @@ -34,15 +40,4 @@ properties: - http://www.opengis.net/def/crs/OGC/1.3/CRS84 example: - http://www.opengis.net/def/crs/OGC/1.3/CRS84 - - http://www.opengis.net/def/crs/EPSG/0/4326 - # additional properties - created: - description: Date of creation - type: string - format: date-time - count: - description: Feature count - type: integer - geometryType: - description: Geometry type of the features - type: string + - http://www.opengis.net/def/crs/EPSG/0/4326 \ No newline at end of file diff --git a/baremaps-ogcapi/src/main/resources/schemas/collections.yaml b/baremaps-ogcapi/src/main/resources/schemas/collections.yaml index 1c01a39f..7ead88e1 100644 --- a/baremaps-ogcapi/src/main/resources/schemas/collections.yaml +++ b/baremaps-ogcapi/src/main/resources/schemas/collections.yaml @@ -6,8 +6,17 @@ properties: links: type: array items: - $ref: "link.yaml" + $ref: link.yaml + timeStamp: + type: string + format: date-time + numberMatched: + type: integer + minimum: 0 + numberReturned: + type: integer + minimum: 0 collections: type: array items: - $ref: "collection.yaml" \ No newline at end of file + $ref: collection.yaml \ No newline at end of file diff --git a/baremaps-ogcapi/src/main/resources/schemas/exception.yaml b/baremaps-ogcapi/src/main/resources/schemas/exception.yaml index 2d087193..8b986c15 100644 --- a/baremaps-ogcapi/src/main/resources/schemas/exception.yaml +++ b/baremaps-ogcapi/src/main/resources/schemas/exception.yaml @@ -1,8 +1,16 @@ +title: Exception Schema +description: JSON schema for exceptions based on RFC 7807 type: object required: - - code + - type properties: - code: + type: type: string - description: + title: + type: string + status: + type: integer + detail: + type: string + instance: type: string \ No newline at end of file diff --git a/baremaps-ogcapi/src/main/resources/schemas/landingPage.yaml b/baremaps-ogcapi/src/main/resources/schemas/landingPage.yaml index 6e75137b..4c9f8d2f 100644 --- a/baremaps-ogcapi/src/main/resources/schemas/landingPage.yaml +++ b/baremaps-ogcapi/src/main/resources/schemas/landingPage.yaml @@ -4,11 +4,17 @@ required: properties: title: type: string + title: The title of the API. + description: While a title is not required, implementors are strongly advised to include one. example: Buildings in Bonn description: type: string - example: Access to data about buildings in the city of Bonn via a Web API that conforms to the OGC API Features specification. + example: Access to data about buildings in the city of Bonn via a Web API that conforms to the OGC API Common specification. + attribution: + type: string + title: attribution for the API + description: The `attribution` should be short and intended for presentation to a user, for example, in a corner of a map. Parts of the text can be links to other resources if additional information is needed. The string can include HTML markup. links: type: array items: - $ref: "link.yaml" \ No newline at end of file + $ref: 'link.yaml' \ No newline at end of file diff --git a/baremaps-ogcapi/src/main/resources/schemas/link.yaml b/baremaps-ogcapi/src/main/resources/schemas/link.yaml index f5d2a062..ad730a4b 100644 --- a/baremaps-ogcapi/src/main/resources/schemas/link.yaml +++ b/baremaps-ogcapi/src/main/resources/schemas/link.yaml @@ -1,21 +1,34 @@ type: object required: - href + - rel properties: href: type: string + description: Supplies the URI to a remote resource (or resource fragment). example: http://data.example.com/buildings/123 rel: type: string + description: The type or semantics of the relation. example: alternate type: type: string + description: A hint indicating what the media type of the result of dereferencing the link should be. example: application/geo+json + templated: + type: boolean + description: This flag set to true if the link is a URL template. + varBase: + description: A base path to retrieve semantic information about the variables used in URL template. + type: string + example: /ogcapi/vars/ hreflang: type: string + description: A hint indicating what the language of the result of dereferencing the link should be. example: en title: type: string + description: Used to label the destination of a link such that it can be used as a human-readable identifier. example: Trierer Strasse 70, 53115 Bonn length: type: integer \ No newline at end of file diff --git a/pom.xml b/pom.xml index 996ea827..96971332 100644 --- a/pom.xml +++ b/pom.xml @@ -105,7 +105,7 @@ <version.lib.proj4j>1.2.3</version.lib.proj4j> <version.lib.protobuf>3.21.6</version.lib.protobuf> <version.lib.roaringbitmap>0.9.38</version.lib.roaringbitmap> - <version.lib.servicetalk>0.42.18</version.lib.servicetalk> + <version.lib.servicetalk>0.42.27</version.lib.servicetalk> <version.lib.servlet>3.1.0</version.lib.servlet> <version.lib.slf4j>2.0.3</version.lib.slf4j> <version.lib.sqlite>3.39.3.0</version.lib.sqlite>
