Skip to content

Conversation

@igalshilman
Copy link
Contributor

@igalshilman igalshilman commented Mar 25, 2025

This PR adds more places to use the DefaultSerde and in addtion adds an optional type_hint argument in various ctx methods, that allows to use a more specific serializer.
For now we only support Pydantic and plain python objects via json.dumps/loads

class State(BaseModel):
   foo ...
   bar ...

res = await ctx.get("state", type_hint=State)

print(res.foo)

@igalshilman igalshilman merged commit d006698 into restatedev:main Mar 25, 2025
4 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 25, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant