You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, FastAPI first validates a request in its correct version, and then we migrate request to latest. For responses, it goes in reverse: we migrate response from latest, and then FastAPI validates the response. This approach tightly binds our versioning logic to FastAPI and causes us to do a lot of hacks. Instead, we should use a middleware that will see each request first and convert it to latest. This will significantly simplify our code and make it easier for us to keep compatibility with future FastAPI versions.
Request comes
pick version (version picking middleware)
migration middleware
Get body for old version
solve_dependencies for old version
convert to latest
set api version header to latest version
run the endpoint
The text was updated successfully, but these errors were encountered:
Currently, FastAPI first validates a request in its correct version, and then we migrate request to latest. For responses, it goes in reverse: we migrate response from latest, and then FastAPI validates the response. This approach tightly binds our versioning logic to FastAPI and causes us to do a lot of hacks. Instead, we should use a middleware that will see each request first and convert it to latest. This will significantly simplify our code and make it easier for us to keep compatibility with future FastAPI versions.
The text was updated successfully, but these errors were encountered: