Skip to content

Commit 810b9b8

Browse files
author
Phil Varner
authored
Merge pull request #20 from stac-api-extensions/pv/fix-openapi-model-composition
fix openapi model composition
2 parents 548d3b3 + 3c6fef3 commit 810b9b8

File tree

3 files changed

+4309
-3314
lines changed

3 files changed

+4309
-3314
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Changed
1111

12+
- Fixed several issues with OpenAPI specification
1213
- Basic Spatial Operators in CQL2 now only requires BBOX and POINT support, so the text
1314
and examples were updated to account for this.
1415

openapi.yaml

Lines changed: 123 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,19 @@ tags:
1111
description: Part of STAC API - Collections definition
1212
- name: Features
1313
description: Part of STAC API - Features definition
14+
- name: Item Search
15+
description: Part of STAC API - Item Search definition
1416
- name: Filter Extension
1517
description: Part of STAC API - Filter extension definition
1618

1719
paths:
18-
'/':
20+
"/":
1921
get:
2022
description: Landing Page
2123
tags:
2224
- Core
2325
responses:
24-
'200':
26+
"200":
2527
description: Landing Page
2628
links:
2729
queryables:
@@ -40,10 +42,10 @@ paths:
4042
tags:
4143
- Filter Extension
4244
responses:
43-
'200':
44-
$ref: '#/components/responses/Queryables'
45+
"200":
46+
$ref: "#/components/responses/Queryables"
4547
default:
46-
$ref: '#/components/responses/Error'
48+
$ref: "#/components/responses/Error"
4749
/collections/{collectionId}:
4850
get:
4951
description: |-
@@ -59,13 +61,48 @@ paths:
5961
required: true
6062
description: ID of Collection
6163
responses:
62-
'200':
64+
"200":
6365
description: Collection description
6466
links:
6567
queryables:
6668
operationId: getQueryablesForCollection
6769
description: |-
6870
A link with rel=queryables for queryables to only apply to this collection.
71+
/collections/{collectionId}/items:
72+
get:
73+
tags:
74+
- Features
75+
- Filter Extension
76+
summary: fetch features
77+
description: |-
78+
Fetch features of the feature collection with id `collectionId`.
79+
80+
Every feature in a dataset belongs to a collection. A dataset may
81+
consist of multiple feature collections. A feature collection is often a
82+
collection of features of a similar type, based on a common schema.
83+
operationId: getFeatures
84+
parameters:
85+
- in: path
86+
name: collectionId
87+
schema:
88+
type: string
89+
required: true
90+
description: ID of Collection
91+
- $ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/parameters/limit"
92+
- $ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/parameters/bbox"
93+
- $ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/parameters/datetime"
94+
- $ref: "#/components/parameters/filter"
95+
- $ref: "#/components/parameters/filter-lang"
96+
- $ref: "#/components/parameters/filter-crs"
97+
responses:
98+
"200":
99+
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/Features"
100+
"404":
101+
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/NotFound"
102+
"4XX":
103+
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/Error"
104+
"5XX":
105+
$ref: "https://api.stacspec.org/v1.0.0/ogcapi-features/openapi.yaml#/components/responses/Error"
69106
/collections/{collectionId}/queryables:
70107
get:
71108
summary: Get the JSON Schema defining the list of variable terms that can be used in CQL2 expressions.
@@ -84,10 +121,74 @@ paths:
84121
tags:
85122
- Filter Extension
86123
responses:
87-
'200':
88-
$ref: '#/components/responses/Queryables'
124+
"200":
125+
$ref: "#/components/responses/Queryables"
89126
default:
90-
$ref: '#/components/responses/Error'
127+
$ref: "#/components/responses/Error"
128+
/search:
129+
get:
130+
summary: Search STAC items with full-featured filtering.
131+
operationId: getItemSearch
132+
description: |-
133+
Retrieve Items matching filters. Intended as a shorthand API for simple
134+
queries.
135+
This method is required to implement.
136+
If this endpoint is implemented on a server, it is required to add a
137+
link referring to this endpoint with `rel` set to `search` to the
138+
`links` array in `GET /`. As `GET` is the default method, the `method`
139+
may not be set explicitly in the link.
140+
tags:
141+
- Item Search
142+
- Filter Extension
143+
parameters:
144+
- $ref: "#/components/parameters/filter"
145+
- $ref: "#/components/parameters/filter-lang"
146+
- $ref: "#/components/parameters/filter-crs"
147+
responses:
148+
"200":
149+
description: A feature collection.
150+
content:
151+
application/geo+json:
152+
schema:
153+
$ref: "https://api.stacspec.org/v1.0.0/item-search/openapi.yaml#/components/schemas/itemCollection"
154+
text/html:
155+
schema:
156+
type: string
157+
"4XX":
158+
$ref: "#/components/responses/Error"
159+
"5XX":
160+
$ref: "#/components/responses/Error"
161+
post:
162+
summary: Search STAC items with full-featured filtering.
163+
operationId: postItemSearch
164+
description: |-
165+
Retrieve items matching filters. Intended as the standard, full-featured
166+
query API.
167+
If this endpoint is implemented on a server, it is required to add a
168+
link referring to this endpoint with `rel` set to `search` and `method`
169+
set to `POST` to the `links` array in `GET /`.
170+
tags:
171+
- Item Search
172+
- Filter Extension
173+
requestBody:
174+
content:
175+
application/json:
176+
schema:
177+
$ref: "#/components/schemas/searchBody"
178+
responses:
179+
"200":
180+
description: A feature collection.
181+
content:
182+
application/geo+json:
183+
schema:
184+
$ref: "https://api.stacspec.org/v1.0.0/item-search/openapi.yaml#/components/schemas/itemCollection"
185+
text/html:
186+
schema:
187+
type: string
188+
"4XX":
189+
$ref: "#/components/responses/Error"
190+
"5XX":
191+
$ref: "#/components/responses/Error"
91192
components:
92193
parameters:
93194
filter:
@@ -101,8 +202,8 @@ components:
101202
required: true
102203
schema:
103204
oneOf:
104-
- $ref: '#/components/schemas/filter-cql2-json'
105-
- $ref: '#/components/schemas/filter-cql2-text'
205+
- $ref: "#/components/schemas/filter-cql2-json"
206+
- $ref: "#/components/schemas/filter-cql2-text"
106207
filter-lang:
107208
name: filter-lang
108209
x-stac-api-fragment: filter
@@ -113,7 +214,7 @@ components:
113214
The CQL2 filter encoding that the 'filter' value uses. Must be one of 'cql2-text' or 'cql2-json'.
114215
required: false
115216
schema:
116-
$ref: '#/components/schemas/filter-lang'
217+
$ref: "#/components/schemas/filter-lang"
117218
filter-crs:
118219
name: filter-crs
119220
x-stac-api-fragment: filter
@@ -125,7 +226,7 @@ components:
125226
is 'http://www.opengis.net/def/crs/OGC/1.3/CRS84'.
126227
required: false
127228
schema:
128-
$ref: '#/components/schemas/filter-crs'
229+
$ref: "#/components/schemas/filter-crs"
129230
schemas:
130231
searchBody:
131232
type: object
@@ -134,26 +235,28 @@ components:
134235
**Extension:** Filter
135236
136237
A filter for properties in Items.
238+
allOf: # Combines the searchBody of Item-filter and the inline model
239+
- $ref: "https://api.stacspec.org/v1.0.0/item-search/openapi.yaml#/components/schemas/searchBody"
137240
properties:
138241
filter:
139-
$ref: '#/components/schemas/filter-cql2-json'
242+
$ref: "#/components/schemas/filter-cql2-json"
140243
filter-lang:
141-
$ref: '#/components/schemas/filter-lang'
244+
$ref: "#/components/schemas/filter-lang"
142245
filter-crs:
143-
$ref: '#/components/schemas/filter-crs'
246+
$ref: "#/components/schemas/filter-crs"
144247
filter-cql2-text:
145248
description: |
146249
A CQL2 filter expression in the 'cql2-text' encoding.
147250
type: string
148251
filter-cql2-json:
149-
$ref: 'https://raw.githubusercontent.com/opengeospatial/ogcapi-features/master/cql2/standard/schema/cql2.yml#/components/schemas/booleanExpression'
252+
$ref: "https://raw.githubusercontent.com/opengeospatial/ogcapi-features/master/cql2/standard/schema/cql2.yml#/components/schemas/booleanExpression"
150253
filter-lang:
151254
description: |
152255
The CQL2 filter encoding that the 'filter' value uses.
153256
type: string
154257
enum:
155-
- 'cql2-text'
156-
- 'cql2-json'
258+
- "cql2-text"
259+
- "cql2-json"
157260
filter-crs:
158261
description: |
159262
The coordinate reference system (CRS) used by spatial literals in the 'filter' value. The only value that STAC APIs must
@@ -183,4 +286,4 @@ components:
183286
content:
184287
application/json:
185288
schema:
186-
$ref: '#/components/schemas/exception'
289+
$ref: "#/components/schemas/exception"

0 commit comments

Comments
 (0)