-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
docs: Document custom types #3603
base: main
Are you sure you want to change the base?
Conversation
docs/usage/custom-types.rst
Outdated
|
||
Data serialization / deserialization (encoding / decoding) and validation are important parts of any API framework. | ||
|
||
Among others, litestar supports Python's builtin dataclasses, Pydantic and msgspec for these tasks, defaulting to msgspec with json as serialization protocol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think "defaulting to msgspec" is the correct phrasing here. Litestar only uses msgspec for serialisation to JSON. It can integrate with Pydantic and others, but doesn't use those to encode anything to JSON directly; It all goes through msgspec eventually.
I'm not sure msgspec needs to be mentioned in this part of the documentation in general, as it's more of an implementation detail. We should mention that that's how it works, but perhaps we can find a better place for that
Co-authored-by: Jacob Coffee <[email protected]>
Documentation preview will be available shortly at https://litestar-org.github.io/litestar-docs-preview/3603 |
Description
type_decoders
andtype_encoders
in order to allow litestar to en/decode custom types via msgspec