Remove links from default include list#524
Closed
gadomski wants to merge 2 commits into
Closed
Conversation
5dc6eb8 to
c0616d8
Compare
4 tasks
**sqlalchemy** uses `FieldsExtension.default_includes`, so its fix was pretty *easy -- I did have to add an explicit include+exclude check to the search function to ensure the fields extension was applied _only if_ either `include` or `exclude` was set. **pgstac** was a little trickier, because it doesn't use the `default_includes` list. I did modify one existing test -- `test_app_fields_extension` in the **sqlalchemy** tests was assuming fields would be stripped just by providing a `collections` parameter to the query, which I think was incorrect -- I added an explicit `include` field to the test.
e13635c to
ed858bd
Compare
2 tasks
Member
Author
|
Converting to draft until stac-api-extensions/fields#5 lands. |
Member
Author
|
Closing as blocked by stac-api-extensions/fields#5. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue(s):
includesstac-fastapi-pgstac#27This is one of two PRs that would fix stac-utils/stac-fastapi-pgstac#27; the other is #527. We should merge one and close the other.
Description:
The fields extension is used to include/exclude fields on items returned by
/search(and/collections/{cid}/items). If a field is not present inincludeorexclude, the extension does not specify whether that field should be present on the response items (though it does provide guidance). Currently,linksis included by default, even if it is not present in theincludelist. This PR changes that behavior to excludelinksby default if there is anincludelist.sqlalchemy uses
FieldsExtension.default_includes, so its fix was pretty easy-- I did have to add an explicit include+exclude check to the search function to ensure the fields extension was applied only if either
includeorexcludewas set. pgstac was a little trickier, because it doesn't use thedefault_includeslist.I did modify one existing test --
test_app_fields_extensionin the sqlalchemy tests was assuming fields would be stripped just by providing acollectionsparameter to the query, which I think is incorrect -- I added an explicitincludefield to the test.PR Checklist:
pre-commit run --all-files)make test)make docs)