Search code examples
pythonfastapipydanticcamelcasing

Convert response to camel case on JS client side and convert request data to snake case on server fastapi


Is there a way to convert incoming body data from JS client side to snake_case, and convert outcoming response data from the server to camelCase. Besides, I want to implement it with Pydantic. By the way, I am a total newbie in FastAPI + Pydantic


Solution

  • There is a helpful python package for it - fastapi_camelcase