How to define global parameters in OpenAPI?

后端 未结 3 1052
萌比男神i
萌比男神i 2020-12-03 05:02

I\'m preparing my API documentation by doing it per hand and not auto generated. There I have headers that should be sent to all APIs and don\'t know if it is possible to de

3条回答
  •  無奈伤痛
    2020-12-03 05:28

    As per this Swagger issue comment, support for global parameters (including header parameters) is not planned in foreseeable future, but to limit the repetition you should use parameters references as in @Arnaud's answer (parameters: - $ref: '#/parameters/paramX').

提交回复
热议问题