I am doing a swagger file and there are some occasions when I use the same object on different cases. I am asking to myself if there is any way to change, for example, the mandatory fields from the place where the object is referenced and not on the object. An example:
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