You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
IrrerPolterer
changed the title
Pydantic base model to parse and dump camelCase JSON, but works with snake_case python code
Pydantic base model to parse and dump camelCase JSON
Feb 21, 2023
IrrerPolterer
changed the title
Pydantic base model to parse and dump camelCase JSON
Pydantic base model to parse and return camelCase JSON
Feb 21, 2023
I want to be able to both...
For this I'm using a custom base model for pretty much all my Pydantic schemas:
(This requires the pyHumps package.)
With this BaseSchema, I can now create pydantic schemas with the intended behavior:
My solution above uses the
camelize
function from the pyhumps package. Alternatively, you can create the function yourself like this:The text was updated successfully, but these errors were encountered: