docs(api): add comments for security schemas and openapi setup

This commit is contained in:
Fanilo-Nantenaina 2026-01-20 13:54:36 +03:00
parent 72d1ac58d1
commit 0001dbe634

2
api.py
View file

@ -181,6 +181,7 @@ def custom_openapi():
openapi_schema = app.openapi()
# Définir deux schémas de sécurité
openapi_schema["components"]["securitySchemes"] = {
"HTTPBearer": {"type": "http", "scheme": "bearer", "bearerFormat": "JWT"},
"ApiKeyAuth": {"type": "apiKey", "in": "header", "name": "X-API-Key"},
@ -192,6 +193,7 @@ def custom_openapi():
return app.openapi_schema
# Après app = FastAPI(...), ajouter:
app.openapi = custom_openapi