Skip to content

Commit

Permalink
Properly allow overriding /collections/{collectionId}/items/{featureI…
Browse files Browse the repository at this point in the history
…d} to replace geojson with stac items #8
  • Loading branch information
m-mohr committed Nov 16, 2020
1 parent 955d2c2 commit 2cb51af
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 43 deletions.
22 changes: 10 additions & 12 deletions STAC-extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,16 @@ paths:
- $ref: '#/components/parameters/featureId'
responses:
'200':
$ref: '#/components/responses/Feature'
description: |-
fetch the feature with id `featureId` in the feature collection
with id `collectionId`
content:
application/geo+json:
schema:
$ref: '#/components/schemas/item'
text/html:
schema:
type: string
headers:
ETag:
schema:
Expand Down Expand Up @@ -2284,17 +2293,6 @@ components:
text/html:
schema:
type: string
Feature:
description: |-
fetch the feature with id `featureId` in the feature collection
with id `collectionId`
content:
application/geo+json:
schema:
$ref: '#/components/schemas/item'
text/html:
schema:
type: string
InvalidParameter:
description: A query parameter has an invalid value.
content:
Expand Down
22 changes: 10 additions & 12 deletions STAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,16 @@ paths:
- $ref: '#/components/parameters/featureId'
responses:
'200':
$ref: '#/components/responses/Feature'
description: |-
fetch the feature with id `featureId` in the feature collection
with id `collectionId`
content:
application/geo+json:
schema:
$ref: '#/components/schemas/item'
text/html:
schema:
type: string
'404':
$ref: '#/components/responses/NotFound'
'500':
Expand Down Expand Up @@ -1718,17 +1727,6 @@ components:
text/html:
schema:
type: string
Feature:
description: |-
fetch the feature with id `featureId` in the feature collection
with id `collectionId`
content:
application/geo+json:
schema:
$ref: '#/components/schemas/item'
text/html:
schema:
type: string
InvalidParameter:
description: A query parameter has an invalid value.
content:
Expand Down
25 changes: 12 additions & 13 deletions openapi/OAFeat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,18 @@ paths:
- $ref: '#/components/parameters/featureId'
responses:
'200':
$ref: '#/components/responses/Feature'
# Moved from #/components/responses/Feature to allow merging with extensions
description: |-
fetch the feature with id `featureId` in the feature collection
with id `collectionId`
content:
application/geo+json:
schema:
$ref: '#/components/schemas/featureGeoJSON'
# Removed example, I can't override it from STAC.yaml
text/html:
schema:
type: string
'404':
$ref: '#/components/responses/NotFound'
'500':
Expand Down Expand Up @@ -797,18 +808,6 @@ components:
text/html:
schema:
type: string
Feature:
description: |-
fetch the feature with id `featureId` in the feature collection
with id `collectionId`
content:
application/geo+json:
schema:
$ref: '#/components/schemas/featureGeoJSON'
# Removed example, I can't override it from STAC.yaml
text/html:
schema:
type: string
InvalidParameter:
description: |-
A query parameter has an invalid value.
Expand Down
15 changes: 9 additions & 6 deletions openapi/STAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ paths:
text/html:
schema:
type: string
# This schema changes the OAFeat endpoint to replace the schema from featureGeoJson to item.
'/collections/{collectionId}/items/{featureId}':
get:
responses:
'200':
content:
application/geo+json:
schema:
$ref: '#/components/schemas/item'
components:
parameters:
ids:
Expand Down Expand Up @@ -198,12 +207,6 @@ components:
rel: search
type: application/json
title: Search across feature collections
# This schema extends OAFeat.yaml#/components/responses/Feature change the schema from featureGeoJson to item.
Feature:
content:
application/geo+json:
schema:
$ref: '#/components/schemas/item'
schemas:
# This schema extends OAFeat.yaml#/components/schemas/collection to add and require additional fields and add an example.
collection:
Expand Down

0 comments on commit 2cb51af

Please sign in to comment.