Configuration for OpenAPI security definitions and requirements.
Useful for specifying global or path-level authentication and authorization flows (e.g., OAuth2, API key headers, etc.).
SecurityConfig()Describe each security scheme recognized by your OpenAPI spec.
Keys are scheme names (e.g. "OAuth2", "ApiKeyAuth") and values are their definitions. Example: { "OAuth2": { "type": "oauth2", "flows": { "password": { "tokenUrl": "/token", "scopes": {"read": "Read data", "write": "Write data"} } } } }
Global security requirements across all endpoints.
Each element in the list maps a security scheme (e.g. "OAuth2") to a list of scopes (e.g. ["read", "write"]). Example: [ {"OAuth2": ["read", "write"]}, {"ApiKeyAuth": []} ]
Path-specific security overrides.
Keys are path templates (e.g., "/items/{item_id}"), mapping to:
security) for that method.