-
Notifications
You must be signed in to change notification settings - Fork 179
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
Sort Extension: simple format for GET #513
Conversation
…m rather than Properties
I like the GET support! :) I have no idea if this is a good idea or bad idea, but what about making the GET values use a similar syntax as the proposed fields values, where a
|
As I wrote up Fields, it's only nothing or |
Moving to 0.9.0 - as there's more thinking to do on this. Sean will sound in with some more thoughts on doing things in headers, and we want to try to align with WFS. |
api-spec/extensions/sort/README.md
Outdated
|
||
Examples of `sort` parameter: | ||
|
||
GET /stac/search?sort=created|asc,id|desc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about replacing |
with ;
? Like GET /stac/search?sort=eo:cloud_cover;desc
. |
may be ambiguous (expressing this or that property, say)
api-spec/extensions/sort/README.md
Outdated
where <direction> is either "asc" (ascending) or "desc" (descending). The `sort` value is an array, so multiple sort fields can be defined which will be used to sort the data in the order provided (e.g., first by `datetime`, then by `eo:cloud_cover`). | ||
```json | ||
{ | ||
"sort": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Borrowing from OGC approaches, what about:
"sort": [
{
"property": "created",
"order": "asc"
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomkralidis can you point me to the documentation for those OGC approaches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- from CSW 2.0.2: http://portal.opengeospatial.org/files/?artifact_id=20555 (Table 65)
- from CSW 3.0: http://docs.opengeospatial.org/is/12-176r7/12-176r7.html (Table 22)
Note relevant conversation in opengeospatial/ogcapi-features#157 |
@philvarner Looks like this might need some updates, thought colon was going to be avoided in favor of semi-colon? |
I think I have all the necessary changes in now @joshfix @tomkralidis @matthewhanson |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be what we have discussed. 👍 Only thing to change is the endpoint path (see comment).
I'm just wondering whether we should use an approach that can be modeled in OpenAPI. We can't properly describe the current behavior except for textual descriptions. I went through the OpenAPI specification and found we could model it properly this way:
This would translate to the following GET query parameters: This translates to the following object, which could also be used in POST:
I'm aware that this is maybe not as short as the other approach, but follows a well-defined behavior. |
properties.created ascending, id
(ascending or descending). Without the id as the secondary sort, items with the same created timestamp would result in a non-stable sort, which may give users incorrect results with trying to page through an entire result set.PR Checklist:
npm run generate-all
. to update the generated OpenAPI files.