-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: message can have nested oneOf (#333)
- Loading branch information
1 parent
cfba936
commit a2f0bb7
Showing
2 changed files
with
161 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"patternProperties": { | ||
"^x-[\\w\\d\\.\\x2d_]+$": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" | ||
} | ||
}, | ||
"properties": { | ||
"schemaFormat": { | ||
"type": "string" | ||
}, | ||
"contentType": { | ||
"type": "string" | ||
}, | ||
"headers": { | ||
"allOf": [ | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" | ||
}, | ||
{ | ||
"properties": { | ||
"type": { | ||
"const": "object" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"messageId": { | ||
"type": "string" | ||
}, | ||
"payload": {}, | ||
"correlationId": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
}, | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" | ||
} | ||
] | ||
}, | ||
"tags": { | ||
"type": "array", | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
}, | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" | ||
} | ||
] | ||
}, | ||
"uniqueItems": true | ||
}, | ||
"summary": { | ||
"type": "string", | ||
"description": "A brief summary of the message." | ||
}, | ||
"name": { | ||
"type": "string", | ||
"description": "Name of the message." | ||
}, | ||
"title": { | ||
"type": "string", | ||
"description": "A human-friendly title for the message." | ||
}, | ||
"description": { | ||
"type": "string", | ||
"description": "A longer description of the message. CommonMark is allowed." | ||
}, | ||
"externalDocs": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
}, | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" | ||
} | ||
] | ||
}, | ||
"deprecated": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"examples": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"anyOf": [ | ||
{ | ||
"required": [ | ||
"payload" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"headers" | ||
] | ||
} | ||
], | ||
"properties": { | ||
"name": { | ||
"type": "string", | ||
"description": "Machine readable name of the message example." | ||
}, | ||
"summary": { | ||
"type": "string", | ||
"description": "A brief summary of the message example." | ||
}, | ||
"headers": { | ||
"type": "object" | ||
}, | ||
"payload": {} | ||
} | ||
} | ||
}, | ||
"bindings": { | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" | ||
}, | ||
"traits": { | ||
"type": "array", | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
}, | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" | ||
}, | ||
{ | ||
"type": "array", | ||
"items": [ | ||
{ | ||
"oneOf": [ | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" | ||
}, | ||
{ | ||
"$ref": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"additionalItems": true | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "http://asyncapi.com/definitions/3.0.0/messageObject.json" | ||
} |