In OpenAPI, how to you restrict a given action (e.g. GET /users) to users with a specific role (e.g. admin)?
Example, where the list of users should only be accessible to admin users:
paths:
/users:
get:
# TODO: restrict access to users with 'admin' role
summary: Get list of all users
security:
- BearerAuth: []
operationId: getUsers
responses:
200:
description: successful operation
content:
application/json:
schema:
type: object
properties:
users:
type: array
items:
$ref: '#/components/schemas/User'