我正在做一个招摇文件,在某些情况下,我在不同的情况下使用相同的对象。我问自己是否有任何改变的方法,例如,引用对象的地方的强制字段而不是对象。一个例子:
ObjectA:
type: object
required:
- A_1
properties:
A_1:
type: string
A_2:
type: string
A_3:
type: string
Object_uses_A_1
type: object
properties:
A:
$ref: '#/definitions/ObjectA'
# Any way to make A_2 a required field of ObjectA in this case??
Other:
type: string
Object_uses_A_2
type: object
properties:
A:
$ref: '#/definitions/ObjectA'
# Any way to make A_3 a required field of ObjectA in this case??
Other:
type: string