Skip to content

Commit

Permalink
openapi: Updated with example definition from building blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
jerstlouis committed Jun 21, 2024
1 parent faca4aa commit 177cfd3
Show file tree
Hide file tree
Showing 48 changed files with 2,113 additions and 3,018 deletions.
23 changes: 23 additions & 0 deletions collections/openapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI definitions

This example API definition can be used to provide an OpenAPI 3.0 definition for an implementation of _OGC API - Common - Part 2: Geospatial Data_.
The API definition can be visualized with [SwaggerUI](https://petstore.swagger.io/?url=https://raw.githubusercontent.com/opengeospatial/ogcapi-common/master/collections/openapi/ogcapi-common-2.bundled.json).

The lists of collections and tile matrix sets in the `/api` sub-directory should be tailored to the implementation and deployment, or those `/api/*` paths can be implemented dynamically by the server instead.

The list of supported paths should be adjusted in `ogcapi-common-2.yaml`.

# Building the OpenAPI bundle

The `ogcapi-common-2.bundled.json` file is a standalone/portable OpenAPI document which includes all dependencies included from the components sub-directories. To build the bundle locally:

```bash
# install Swagger CLI via npm
npm install -g @apidevtools/swagger-cli

# generate OpenAPI bundle
cd standard/openapi
swagger-cli bundle -o ogcapi-common-2.bundled.json ogcapi-common-2.yaml
```

See also [Swagger CLI](https://apitools.dev/swagger-cli/) and its [GitHub repository](https://github.com/APIDevTools/swagger-cli).
3 changes: 3 additions & 0 deletions collections/openapi/api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
These stand-in API resources are intended to dynamically enumerate specific types of implementation/deployment-dependent available resources in responses to `/api/*`.

Alternatively, those resources could be directly enumerated in `schemas/dynamic/*`
12 changes: 12 additions & 0 deletions collections/openapi/api/all-collections.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type" : "string",
"enum" : [
"blueMarble",
"NaturalEarth:raster:HYP_HR_SR_OB_DR",
"NaturalEarth:cultural:ne_10m_admin_0_countries",
"NaturalEarth:physical:bathymetry",
"SRTM_ViewFinderPanorama",
"HRDEM-Ottawa",
"HRDEM-RedRiver"
]
}
Loading

0 comments on commit 177cfd3

Please sign in to comment.