Skip to content
Advertisement

Tag: pydantic

List of object attributes in pydantic model

I use Fast API to create a web service. There are following sqlAlchemy models: Pydantic schemas are below: What I have now is: What I want to achieve is to get user from api in following structure: Is that possible? How should I change schemas to get this? Answer If you are okay with handling the how to “get user

Partial update in FastAPI

I want to implement a put or patch request in FastAPI that supports partial update. The official documentation is really confusing and I can’t figure out how to do the request. (I don’t know that items is in the documentation since my data will be passed with request’s body, not a hard-coded dict). How can I complete my code to

Advertisement