From fefa0af3536db7ce480896fb5f9e6ad3e73140c6 Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Tue, 26 Jul 2022 14:11:30 +0200 Subject: [PATCH 1/7] feat: add reusable tags and externalDocs objects --- definitions/3.0.0/components.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index fd2df606..44ca9b20 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -91,6 +91,18 @@ "additionalProperties": { "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" } + }, + "tags": { + "type": "object", + "additionalProperties": { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + }, + "externalDocs": { + "type": "object", + "additionalProperties": { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } } }, "$schema": "http://json-schema.org/draft-07/schema#", From 973d227d65f7aa7e1bc184fa6eafaf9064d5f1cb Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Tue, 26 Jul 2022 14:44:46 +0200 Subject: [PATCH 2/7] add references for tags and external docs --- definitions/3.0.0/asyncapi.json | 9 ++++++++- definitions/3.0.0/components.json | 18 ++++++++++++++++-- definitions/3.0.0/message.json | 18 ++++++++++++++++-- definitions/3.0.0/messageTrait.json | 18 ++++++++++++++++-- definitions/3.0.0/operation.json | 18 ++++++++++++++++-- definitions/3.0.0/schema.json | 9 ++++++++- definitions/3.0.0/tag.json | 9 ++++++++- 7 files changed, 88 insertions(+), 11 deletions(-) diff --git a/definitions/3.0.0/asyncapi.json b/definitions/3.0.0/asyncapi.json index 4042edfc..46e750bd 100644 --- a/definitions/3.0.0/asyncapi.json +++ b/definitions/3.0.0/asyncapi.json @@ -47,7 +47,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 }, diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index 44ca9b20..f7c7a7d1 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -95,13 +95,27 @@ "tags": { "type": "object", "additionalProperties": { - "$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" + } + ] } }, "externalDocs": { "type": "object", "additionalProperties": { - "$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" + } + ] } } }, diff --git a/definitions/3.0.0/message.json b/definitions/3.0.0/message.json index 2cefb300..26bdb168 100644 --- a/definitions/3.0.0/message.json +++ b/definitions/3.0.0/message.json @@ -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 }, @@ -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", diff --git a/definitions/3.0.0/messageTrait.json b/definitions/3.0.0/messageTrait.json index 5dbc42e2..b6d33df4 100644 --- a/definitions/3.0.0/messageTrait.json +++ b/definitions/3.0.0/messageTrait.json @@ -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 }, @@ -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", diff --git a/definitions/3.0.0/operation.json b/definitions/3.0.0/operation.json index d29882cf..ca760ce2 100644 --- a/definitions/3.0.0/operation.json +++ b/definitions/3.0.0/operation.json @@ -66,12 +66,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" diff --git a/definitions/3.0.0/schema.json b/definitions/3.0.0/schema.json index c5770a09..7f08ab44 100644 --- a/definitions/3.0.0/schema.json +++ b/definitions/3.0.0/schema.json @@ -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", diff --git a/definitions/3.0.0/tag.json b/definitions/3.0.0/tag.json index 32d3413b..135fd63b 100644 --- a/definitions/3.0.0/tag.json +++ b/definitions/3.0.0/tag.json @@ -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": { From afad192269ede68cc1bd70e3e8e58f215fa106fa Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Wed, 27 Jul 2022 13:18:25 +0200 Subject: [PATCH 3/7] update externalDocs --- definitions/3.0.0/asyncapi.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/definitions/3.0.0/asyncapi.json b/definitions/3.0.0/asyncapi.json index 46e750bd..88eff0a6 100644 --- a/definitions/3.0.0/asyncapi.json +++ b/definitions/3.0.0/asyncapi.json @@ -59,7 +59,14 @@ "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" + } + ] } } } \ No newline at end of file From 6110efeef431056afd8b2e3908f647b6c9ff22ea Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Mon, 6 Feb 2023 12:28:14 +0100 Subject: [PATCH 4/7] update tags and externalDocs in info object --- definitions/3.0.0/info.json | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/definitions/3.0.0/info.json b/definitions/3.0.0/info.json index b3f3d877..b6fb26c4 100644 --- a/definitions/3.0.0/info.json +++ b/definitions/3.0.0/info.json @@ -38,13 +38,27 @@ "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#", "$id": "http://asyncapi.com/definitions/3.0.0/info.json" From 4583056e4b25494d1ea721ef2f0713cd7f26fa65 Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Mon, 6 Feb 2023 12:28:54 +0100 Subject: [PATCH 5/7] remove tags and externalDocs from root --- definitions/3.0.0/asyncapi.json | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/definitions/3.0.0/asyncapi.json b/definitions/3.0.0/asyncapi.json index 88eff0a6..0157a6dd 100644 --- a/definitions/3.0.0/asyncapi.json +++ b/definitions/3.0.0/asyncapi.json @@ -43,30 +43,6 @@ }, "components": { "$ref": "http://asyncapi.com/definitions/3.0.0/components.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" - } - ] } } } \ No newline at end of file From 82ab6e412268adf8536d667cb4facfdb3fb48c35 Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Mon, 6 Feb 2023 12:32:43 +0100 Subject: [PATCH 6/7] add tags and externalDocs to channel and server --- definitions/3.0.0/channel.json | 24 +++++++++++++++++++----- definitions/3.0.0/server.json | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 5 deletions(-) diff --git a/definitions/3.0.0/channel.json b/definitions/3.0.0/channel.json index bd7d9e63..19e56e6a 100644 --- a/definitions/3.0.0/channel.json +++ b/definitions/3.0.0/channel.json @@ -32,18 +32,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#", diff --git a/definitions/3.0.0/server.json b/definitions/3.0.0/server.json index 20371d0f..9fc13147 100644 --- a/definitions/3.0.0/server.json +++ b/definitions/3.0.0/server.json @@ -34,6 +34,30 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.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" } From a6d2e30c783fab811339abe8c5f724d6258a329f Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Mon, 6 Feb 2023 12:33:33 +0100 Subject: [PATCH 7/7] fix info object --- definitions/3.0.0/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/definitions/3.0.0/info.json b/definitions/3.0.0/info.json index b6fb26c4..bf8c1491 100644 --- a/definitions/3.0.0/info.json +++ b/definitions/3.0.0/info.json @@ -58,7 +58,7 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" } ] - }, + } }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/info.json"