如果使用allOf是否可以覆盖键值?

时间:2019-02-07 05:15:26

标签: swagger openapi

我是openAPI 3.0规范的新手,想知道是否可以覆盖statussomestatus的键吗?

Response:
  type: object
  properties:
    status: # want to override this key
      type: number
      format: int32
    timestamp:
      type: string
      format: date-time
ApiResponse:
  allOf:
    - $ref: '#/components/schemas/Response'
    - type: object
  properties:
    message:
      type: string
      format: string

响应具有字段状态,因此ApiResponse将对其进行扩展。现在可以在ApiResponse中将键值status覆盖为something else了。 我们的模式已经相当完善,因此只提出了这个通用示例。我认为这是不可能的,但我仍然想问清楚。

0 个答案:

没有答案