【发布时间】:2020-06-08 11:44:31
【问题描述】:
我有响应结构:
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
data:
allOf:
- { $ref: ../../components/schemas/Product.yaml }
example:
active: false
还有 Product.yaml 之一:
type: object
description: Product
properties:
id:
description: ID
type: integer
example: 1
name:
description: Name
type: string
example: 'fresh baguette'
active:
description: Is active
type: boolean
example: true
所以我想覆盖活动示例,当我这样做时:
data:
allOf:
- { $ref: ../../components/schemas/Product.yaml }
example:
active: false
在“响应样本”下的 redoc ui 中,我看到了唯一的活动属性。
我的问题是如何在不覆盖每个产品属性的情况下覆盖仅活动属性的示例?
【问题讨论】:
-
我的openapi版本是3.0.2