-
Notifications
You must be signed in to change notification settings - Fork 32
Adding support for default environment variable to SFEOS for the number of returned items and STAC collections #419
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
Conversation
Add tests to verify the STAC_ITEM_LIMIT environment variable correctly limits returned items in all the following endpoints:
- Collections list (`/collections`)
- Search results (`/search`)
- Collection items (`/collections/{id}/items`)
Ensures the pagination and result limiting behaves as expected in the API.
This commit introduces the STAC_ITEM_LIMIT environment variable to control the maximum number of items
returned by key API endpoints:
- GET /collections - Limits collections returned
- GET /collections/{collection_id}/items - Limits items in a collection
- GET /search - Limits search results
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.
Super cool
CHANGELOG.md
Outdated
|
|
||
| ### Added | ||
|
|
||
| - Added default environment variable `STAC_ITEM_LIMIT` to SFEOS for result limiting of returned items and STAC collections |
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.
Hi. This will need to be moved to the Unreleased section. It can be included in the next release. Also, can you add a link to the pull request number.
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.
@jonhealy1 I have moved the changelog comment from Added to Unreleased and added a reference to the pull request number.
|
Looks great |
2cf463c to
4a0a813
Compare
4a011f6 to
3f5c978
Compare
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.
@YuriZmytrakov Thank you
Thank you for merging @jonhealy1 ! |
…er of returned items and STAC collections (stac-utils#419) **Description:** At the moment, the default number of returned items and STAC collections is hardcoded as `10` and can not be changed, except by adding `limit` query parameter to the URL. This update introduces the `STAC_ITEM_LIMIT` environment variable, allowing us to customize the default limit for returned items and STAC collections. **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog --------- Co-authored-by: Yuri Zmytrakov <[email protected]>
Description:
At the moment, the default number of returned items and STAC collections is hardcoded as
10and can not be changed, except by addinglimitquery parameter to the URL. This update introduces theSTAC_ITEM_LIMITenvironment variable, allowing us to customize the default limit for returned items and STAC collections.PR Checklist:
pre-commit run --all-files)make test)