-
Notifications
You must be signed in to change notification settings - Fork 100
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
Cannot use custom fields in Items #646
Comments
Hi @giorgiobasile. I think the correct place to address this is actually in the extension itself. If you look here it says: "Additional attributes relating to an Item should be added into the Item Properties object, rather than directly in the Item object." The |
@jonhealy1 that's a great find, I understand. If you agree, I would consider the issue closed, and I'll open another one on the Rendering repo, to see whether they would consider changing it according to that recommendation. Thank you again for helping out, appreciated! |
I think renders should be in properties, not on the top-level. Feels more like an issue with the extension itself though: stac-extensions/render#4 |
Thanks @m-mohr, I would just also mention this section of the spec. According to the document, there would be the nesting issue to be considered if |
Maybe renders can be flattened into a number of properties? |
The problem I see is that |
The nesting is only a niche issue for old GeoJSON tooling. Other extensions use nested maps without issues. The bigger issue is obviously to add top level properties to Items ;) |
can we close this issue? is there anything that need fixing in stac-fastapi? |
Yes, no fix needed, the issue can be closed. Thanks everyone for helping out! |
This issue follows: stac-utils/stac-fastapi-pgstac#93
In a nutshell, while trying to upload Items adhering to the Rendering extension using the
POST /collection/{collection_id}/items
API, I noticed that any additional custom field set at the Item level - not as a property - would be ignored by the transactional endpoints. This would basically hinder the ability to work with any extension that mandates the usage of additional fields at the Item level.The payload I'm trying to use looks like:
but the API responds with 200 OK and a similar Item, but without the
renders
object. The jsonb blob stored in the database doesn't have that field either.With the help of @jonhealy1 we pinpointed the issue in this pydantic model, that does not allow for extra fields to be carried along during parsing happening in the transactional endpoints.
A potential solution would be to just specify:
and I'd be happy to send a PR, but I'm not sure whether that would actually solve the issue and what kinds of side-effects that could have, also for the other non-transactional endpoints. Any thoughts?
The text was updated successfully, but these errors were encountered: