Skip to content

Tag: fastapi

Architecture Flask vs FastAPI

I have been tinkering around Flask and FastAPI to see how it acts as a server. One of the main things that I would like to know is how Flask and FastAPI deal with multiple requests from multiple clients. Especially when the code has efficiency issues (long database query time). So, I tried making a simple cod…

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 &#822…

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…