-
Notifications
You must be signed in to change notification settings - Fork 28
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
PgSTAC: Fields extension includes links even if not listed in includes
#27
Comments
This is legal behavior wrt the Fields Extension -- the list of fields is only expressing a client preference rather than a response requirement. (However, I do think it's reasonable to exclude the links if they're not in the fields list, since that can be a large field.) |
It looks like this was changed in stac-utils/stac-fastapi#397 so that links are not returned unless explicitly included in |
I misinterpreted that PR, the test above still fails. However, that PR did add code to allow the client to specifically exclude body = {"fields": {"include": ["id", "collection"], "exclude": ["links"]}} gets the desired effect. @lossyrob @philvarner Given that the field list is more like a preference than rules, does this seem to be sufficient? |
I've implemented a fix for this issue here, but after reading https://github.com/stac-api-extensions/fields#includeexclude-semantics, I think this issue is invalid. Combining
with
implies that |
As I said before: This is legal behavior wrt the Fields Extension -- the list of fields is only expressing a client preference rather than a response requirement. So, this is not a bug because of STAC API conformance, but it may still be a desired change in the behavior of stac-fastapi. |
Understood.
I've opened stac-utils/stac-fastapi#524 to push towards a decision on desired behavior. Reopening this issue, linked to stac-utils/stac-fastapi#524. |
I agree with @mmcfarland here. that it's cumbersome to explicitly specify excludes in order to cancel out the default includes. It may require some experimentation since it may not be explicitly advertised what a particular implementation includes. I've never much cared for the default includes, if you specify includes or excludes then of course you understand that it may make items invalid. They seem like unnecessary guardrails, since you can override them anyway with excludes, why the extra step to try to protect users? I realize we aren't talking about removing the default set of includes, but if we are to keep them then In addition to that, the |
I'm moving this issue out of the 2.4.4 milestone as it's taking a while to resolve, and I really would like to start working on the backend refactor (process outlined here: stac-utils/stac-fastapi#517). To reduce the PR clutter, I've closed the two relevant PRs, but left their branches around for reference:
Once stac-api-extensions/fields#5 is merged and released, we should align with those recommendations. |
This test currently fails:
with
Links shouldn't be included in the response if they aren't in the "include" list.
The text was updated successfully, but these errors were encountered: