Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bbox improvements #50

Merged
merged 10 commits into from
Nov 4, 2020
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions STAC-extensions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,11 @@ components:
maxItems: 6
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
items:
type: number
oneOf:
- minItems: 4
maxItems: 4
- minItems: 6
maxItems: 6
style: form
explode: false
collectionId:
Expand Down
5 changes: 5 additions & 0 deletions STAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ components:
maxItems: 6
items:
type: number
oneOf:
- minItems: 4
maxItems: 4
- minItems: 6
maxItems: 6
style: form
explode: false
collectionId:
Expand Down
4 changes: 2 additions & 2 deletions api-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ This Link should look like:

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.
string values (with no outer brackets \[ or \]) and JSON entity attributes should use JSON Arrays.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused. So it's comma separated values, but "JSON entity attributes should use JSON Arrays"? Does that conflict? What does "JSON entity attributes should use JSON Arrays" actually mean?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 90% sure that this means:

  • If you are using query string parameters (GET request to /search/) you should do bbox=10,10,20,20
  • If you are using JSON requests (POST to /search/) then you should do "bbox": [10,10,20,20]

But obviously, that is not clear. If my explanation makes sense then I can expand this description out. It occurs to me we should also just remove the 'form parameters', and perhaps put it back in if we do #4

Copy link
Collaborator

@m-mohr m-mohr Nov 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Let's better improve that, too, but I'm approving anyway for now as the main issue has been solved.


| Parameter | Type | APIs | Description |
| ----------- | ---------------- | ------------ | ----------- |
Expand All @@ -148,7 +148,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

Expand Down
7 changes: 5 additions & 2 deletions openapi/STAC.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,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
Expand Down