Aller au contenu

API versioning (ARCH2202)

Ce contenu n’est pas encore disponible dans votre langue.

Key python.quality.api-versioning · Severity info · Category quality

API routes without an explicit version make it hard to ship breaking changes without disrupting clients. Add the version to the path or an attribute.

@app.get("/users")
def list_users():
return repo.all()
@app.get("/v1/users")
def list_users():
return repo.all()

Add an explicit API version (e.g. a /v1 path prefix) to the routes.