diff --git a/CHANGELOG.md b/CHANGELOG.md index 09c2c67e..939e1727 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### Fixed +- BBOX openapi yaml to only allow 4 or 6 element arrays ## Older versions diff --git a/STAC-extensions.yaml b/STAC-extensions.yaml index 7414098d..969b1158 100644 --- a/STAC-extensions.yaml +++ b/STAC-extensions.yaml @@ -527,8 +527,11 @@ components: required: false schema: type: array - minItems: 4 - maxItems: 6 + oneOf: + - minItems: 4 + maxItems: 4 + - minItems: 6 + maxItems: 6 items: type: number style: form diff --git a/STAC.yaml b/STAC.yaml index eced971b..13744521 100644 --- a/STAC.yaml +++ b/STAC.yaml @@ -283,8 +283,11 @@ components: required: false schema: type: array - minItems: 4 - maxItems: 6 + oneOf: + - minItems: 4 + maxItems: 4 + - minItems: 6 + maxItems: 6 items: type: number style: form diff --git a/api-spec.md b/api-spec.md index d41fd2ca..a42bf89a 100644 --- a/api-spec.md +++ b/api-spec.md @@ -185,11 +185,30 @@ to get to the next page without mirroring the entire query structure back to the Example requests can be found in the [examples document](./examples.md#paging). -## Filter Parameters and Fields +## Query Parameters and Fields -Unless otherwise noted by **Path-only**, these filters are passed as query string parameters, form parameters, or JSON -entity fields. For filters that represent a set of values, query and form parameters should use comma-separated -string values and JSON entity attributes should use JSON Arrays. +The following list of parameters is used to narrow search queries. Most all of them can be represented as +query string parameters in a GET request, or as JSON entity fields in a POST request. One parameter, +`collectionId` is designated as **Path-only**, which means it should only be used as a query string parameter. +The `collections` parameter works similarly, but takes multiple collectionId's in an array, so it can be used +with a single value array in JSON if the same functionality is desired. For filters that represent a set of values, +query parameters should use comma-separated string values (with no outer brackets \[ or \]) and JSON entity +attributes should use JSON Arrays. + +### Examples + +```http +GET /search?collections=landsat8,sentinel&bbox=-10.415,36.066,3.779,44.213&limit=200&datetime=2017-05-05T00:00:00Z +``` + +```json +{ + "collections": ["landsat8","sentinel"], + "bbox": [10.415,36.066,3.779,44.213], + "limit": 200, + "datetime": "2017-05-05T00:00:00Z" +} +``` | Parameter | Type | APIs | Description | | ----------- | ---------------- | ------------ | ----------- | @@ -202,7 +221,7 @@ string values and JSON entity attributes should use JSON Arrays. | collections | \[string] | STAC | Array of Collection IDs to include in the search for items. Only Items in one of the provided Collections will be searched | Only one of either **intersects** or **bbox** should be specified. If both are specified, a 400 Bad Request response -should be returned. +should be returned. See [examples](examples.md) to see sample requests. ## Reserved Parameters diff --git a/openapi/OAFeat.yaml b/openapi/OAFeat.yaml index 4f1c2036..8fdb26d2 100644 --- a/openapi/OAFeat.yaml +++ b/openapi/OAFeat.yaml @@ -152,8 +152,11 @@ components: required: false schema: type: array - minItems: 4 - maxItems: 6 + oneOf: + - minItems: 4 + maxItems: 4 + - minItems: 6 + maxItems: 6 items: type: number style: form diff --git a/openapi/STAC.yaml b/openapi/STAC.yaml index d1d239d3..9e0e1132 100644 --- a/openapi/STAC.yaml +++ b/openapi/STAC.yaml @@ -137,8 +137,6 @@ components: explode: false # This schema extends OAFeat.yaml#/parameters/bbox. bbox: - name: bbox - in: query description: |- Only features that have a geometry that intersects the bounding box are selected. The bounding box is provided as four or six numbers, depending on @@ -174,15 +172,6 @@ components: WGS 84 (from 160.6°E to 170°W and from 55.95°S to 25.89°S) would be represented in JSON as `[160.6, -55.95, -170, -25.89]` and in a query as `bbox=160.6,-55.95,-170,-25.89`. - required: false - schema: - type: array - minItems: 4 - maxItems: 6 - items: - type: number - style: form - explode: false responses: # This schema extends OAFeat.yaml#/components/responses/LandingPage. LandingPage: