Closed gomete closed 3 years ago
Add discriminator support. It is in the specification and currently, there is no way to mark the polymorphism and inheritance using discriminators.
"oneOf" is not part of the schema but it is supported in the AsyncAPI playground:
{ "asyncapi": "2.0.0", "info": { "title": "Example AsyncAPI", "version": "v1" }, "defaultContentType": "application/json", "channels": { "MessagePublished": { "publish": { "operationId": "events", "message": { "payload": { "$ref": "#/components/schemas/event" }, "name": "event" } } } }, "components": { "schemas": { "event": { "required": ["provider"], "discriminator": "provider", "oneOf": [ { "$ref": "#/components/schemas/aEventSubType" }, { "$ref": "#/components/schemas/otherEventSubType" } ] }, "aEventSubType": { "required": ["provider", "name"], "properties": { "provider": { "type": "string", "description": "aEventSubType." }, "name": { "type": "string", "description": "aEventSubType name." } } }, "otherEventSubType": { "required": ["provider", "name"], "properties": { "provider": { "type": "string", "description": "otherEventSubType." }, "name": { "type": "string", "description": "otherEventSubType name." }, "additionalProperty": { "type": "string", "description": "otherEventSubType additionalProperty." } } } } } }
Closed by #86
Add discriminator support. It is in the specification and currently, there is no way to mark the polymorphism and inheritance using discriminators.
"oneOf" is not part of the schema but it is supported in the AsyncAPI playground: