如何在Open API 3中为所有端点添加默认响应

时间:2019-11-19 09:27:17

标签: swagger openapi

paths:
  /pet:
    post:
      responses:
       '429':
      description: to many requests in the given timeframe
      schema:
      $ref: '#/definitions/error'

因为每个路径我都定义了404,401和响应文档。

我可以为所有这样的api定义通用响应

openapi:
 responses:
  '429':
    description: to many requests in the given timeframe
    schema:
      $ref: '#/definitions/error'

0 个答案:

没有答案