openapi: 3.0.0 info: title: Test version: 1.0.0 servers: - url: / paths: {} components: schemas: NestedObject1: properties: field1: description: Specifies an action name to be used with the Android Intent class. type: string required: - field1 NestedObject2: properties: field2: description: Specifies an action name to be used with the Android Intent class. type: string required: - field2 Object: oneOf: - $ref: '#/components/schemas/NestedObject1' - $ref: '#/components/schemas/NestedObject2' Object2: anyOf: - $ref: '#/components/schemas/NestedObject1' - $ref: '#/components/schemas/NestedObject2' Object3: allOf: - $ref: '#/components/schemas/NestedObject1' - $ref: '#/components/schemas/NestedObject2'