Skip to content

Conversation

@vincentsarago
Copy link
Member

@vincentsarago vincentsarago commented Apr 26, 2024

Not sure why this was not in #625

Note: we should add a note in the changelog that transaction endpoint now have Pydantic Model instead of TypedDict as input (stac-utils/stac-fastapi-pgstac#108 (comment))

@vincentsarago vincentsarago requested a review from jonhealy1 April 26, 2024 21:23
@vincentsarago vincentsarago merged commit e4e4120 into main May 2, 2024
@vincentsarago vincentsarago deleted the patch/PutCollection-pydantic-model branch May 2, 2024 08:19
"""Update Collection."""

collection: stac.Collection = attr.ib(default=Body(None))
collection: Collection = attr.ib(default=Body(None))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonhealy1 I'm not sure why but when we use this class (attr) we don't get the validation/serialization 😬

from stac_fastapi.extensions.core.transaction import PutCollection

>>> PutCollection(collection_id='yo', collection={})
PutCollection(collection_id='yo', collection={})

>>> print(type(PutCollection(collection_id='yo', collection={}).collection))
<class 'dict'>

you may have seen this also in the elastic search backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants