Refactoring: properly define pydantic models and make use of automatic request body mapping
If pydantic models are properly defined according to expected/allowed request body values, automatic JSON-to-object mapping is done by FastAPI. Key/value parsing of Dict structures would be obsolete and processing in general much more robust.