API Versioning and API Routers
-
When we provide apis we need to ensure our changes would not impact existing consumers.
-
What if i want to develop a better apis. This is where api versioning will help
- You have an endpoint which is
/productswe will expose to the consumers as
/v1/products
- Find out in fast api how to add /v1 to existing routes.
@app.post("/products")
-
Refer Here for the changes done to include routers
-
Refer Here for setting status codes
-
If my request schema and response schema for the same resource is differnt how to handle it.
- To solve this we use RequestModel and Response Model Seperately Refer Here for the changes.
