An OpenAPI security requirement declares which security scheme an API or its operations require. In a JWT bearer setup, it connects the documented scheme to protected requests. section 25.5
Configure authentication documentation in two steps:
- Define the scheme, such as bearer authentication, OAuth 2.0, or OpenID Connect. section 25.5
- Add a security requirement to declare which endpoints use that scheme; applying it to the API protects the whole API. section 25.5
- Swagger UI then provides an Authorize button, stores the entered Bearer token, and attaches it to later requests in the Authorization header. section 25.5
