Skip to content

How to use prefer_alias? #2938

Answered by JacobCoffee
danielniccoli asked this question in Q&A
Discussion options

You must be logged in to vote

You can set this by doing something like

pydantic_plugin = PydanticPlugin(prefer_alias=True)
app = Litestar(route_handlers=[...], plugins=[pydantic_plugin])

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@JacobCoffee
Comment options

@JacobCoffee
Comment options

@danielniccoli
Comment options

Answer selected by Alc-Alc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants