Forum Discussion
ponelat
Staff
3 years agoHi w00x
In addition to the stuff you can add with security (docs here https://swagger.io/docs/specification/authentication/ ). You can also describe that requests need special headers, by using (header) parameters https://swagger.io/docs/specification/describing-parameters/#header-parameters.
It's also possible to use the `apiKey` type of security to require a header, something like the following might work...
openapi: 3.0.3
info:
title: Foo
version: 1.0.0
paths:
/foo:
get:
description: ok
security:
- sec1: []
- sec2: []
responses:
default:
description: ok
components:
securitySchemes:
sec1:
type: oauth2
flows:
clientCredentials:
tokenUrl: example.com
scopes: {}
sec2:
type: apiKey
in: header
name: 'Some-Header'