Python Classroom notes 21/May/2026

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 /products we 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.

By continuous learner

enthusiastic technology learner

Leave a Reply

Discover more from Direct AI Powered By Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading