kip
6 years agoNew Contributor
schema via oneOf with additional common properties
Hey everyone,
I am trying to achieve the following, but with the commented lines uncommented. Uncommented it is not syntactically correct, but semantically I am trying to add BodyCommon's prope...
- 6 years ago
You need an "allOf" of BodyCommon and "oneOf":
components: schemas: SomeClientPostBody: required: true content: application/json: schema: allOf: - oneOf: - $ref: "#/components/schemas/BodyTypeA" - $ref: "#/components/schemas/BodyTypeB" - $ref: "#/components/schemas/BodyCommon"