What happens is whenever we create models in FastAPI we create the variables in snake_case as per the PEP-8 standard, however in the frontend it requires camel-case fields. To solve this issue we should use Pydantic Aliases. Please refer this for more info.