I have defined model A which has two fields, field1 is required.
A:
type: object
required:
- field1
properties:
field1:
type: string
field2:
type: string
I want to create a new schema B, which has the same fields as A, but both fields are required.
Could I write it like this?
B:
allOf:
- $ref: '#/components/schemas/A'
- type: object
required:
- field2