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
Since we only make use of Flask for the API we consider using something that is built for API development. I propose using something like FastAPI for two reasons:
Larger community that seems to be more long-term sustainable than Flask and its plugins
Gets us closer to something built for async rather than patched in later
There are some huge changes that would need to be addressed
FastAPI is using Pydantic for their models and data validation, which can be paired with SQLAlchemy using SQLModel
FastAPI is primarily an ASGI app, compared to Flask which is WSGI
Figure out how to handle API versioning and what actual implementation differences there would be to change
However there is an option that we can utilize to have a gradual move
We can for now hardcode WSGI and mount Flask as a middleware for a specific endpoint (i.e. keep Flask running on /api/ and running FastAPI on /api/v1 and /api/nightly/ or something similar
Benefit
Faster API application with currently easier future maintainability
Gives us two main impactful things that is otherwise difficult to handle in the current server and API
Documented endpoints with a greater flexibility on how endpoint data is structured, which gives us a chance to avoid modifying requests like we currently do and instead put that into the model
Async and WebSockets -- Currently this is difficult to do in Flask and with WebSockets not being a first-class citizen it becomes a weird way to write WebSocket support
As well as forcing us to make good API decisions regarding versioning, and proper pagination structure
What is the impacted category (job)?
General
Workaround
There is an existing workaround that can be used until this feature is implemented.
Participation
I am willing to submit a pull request for this issue. (Packit team is happy to help!)
The text was updated successfully, but these errors were encountered:
Description
Since we only make use of Flask for the API we consider using something that is built for API development. I propose using something like FastAPI for two reasons:
There are some huge changes that would need to be addressed
However there is an option that we can utilize to have a gradual move
/api/
and running FastAPI on/api/v1
and/api/nightly/
or something similarBenefit
/api/v1
/api/v2
,/api/latest
)Importance
Medium-High importance
Gives us two main impactful things that is otherwise difficult to handle in the current server and API
As well as forcing us to make good API decisions regarding versioning, and proper pagination structure
What is the impacted category (job)?
General
Workaround
Participation
The text was updated successfully, but these errors were encountered: