Skip to content

Commit

Permalink
feat: add reusable tags and externalDocs objects (#245)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Feb 7, 2023
1 parent a74c78f commit 290bbf5
Show file tree
Hide file tree
Showing 10 changed files with 149 additions and 25 deletions.
10 changes: 0 additions & 10 deletions definitions/3.0.0/asyncapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,6 @@
},
"components": {
"$ref": "http://asyncapi.com/definitions/3.0.0/components.json"
},
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
},
"uniqueItems": true
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
}
}
24 changes: 19 additions & 5 deletions definitions/3.0.0/channel.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,32 @@
},
"uniqueItems": true
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json"
},
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
},
"uniqueItems": true
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json"
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
26 changes: 26 additions & 0 deletions definitions/3.0.0/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,32 @@
"additionalProperties": {
"$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json"
}
},
"tags": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
}
},
"externalDocs": {
"type": "object",
"additionalProperties": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
}
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
18 changes: 16 additions & 2 deletions definitions/3.0.0/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,26 @@
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
},
"uniqueItems": true
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#",
Expand Down
18 changes: 16 additions & 2 deletions definitions/3.0.0/message.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
},
"uniqueItems": true
},
Expand All @@ -87,7 +94,14 @@
"description": "A longer description of the message. CommonMark is allowed."
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
},
"deprecated": {
"type": "boolean",
Expand Down
18 changes: 16 additions & 2 deletions definitions/3.0.0/messageTrait.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
},
"uniqueItems": true
},
Expand All @@ -64,7 +71,14 @@
"description": "A longer description of the message. CommonMark is allowed."
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
},
"deprecated": {
"type": "boolean",
Expand Down
18 changes: 16 additions & 2 deletions definitions/3.0.0/operation.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,26 @@
"tags": {
"type": "array",
"items": {
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/tag.json"
}
]
},
"uniqueItems": true
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json"
Expand Down
9 changes: 8 additions & 1 deletion definitions/3.0.0/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@
"type": "string"
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
},
"deprecated": {
"type": "boolean",
Expand Down
24 changes: 24 additions & 0 deletions definitions/3.0.0/server.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,30 @@
"security": {
"$ref": "http://asyncapi.com/definitions/3.0.0/securityRequirements.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
},
"externalDocs": {
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
},
"bindings": {
"$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json"
}
Expand Down
9 changes: 8 additions & 1 deletion definitions/3.0.0/tag.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,14 @@
"type": "string"
},
"externalDocs": {
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
"oneOf": [
{
"$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json"
},
{
"$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json"
}
]
}
},
"patternProperties": {
Expand Down

0 comments on commit 290bbf5

Please sign in to comment.