diff --git a/api.py b/api.py index 0196fa7..851608c 100644 --- a/api.py +++ b/api.py @@ -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