From b65a5fecea7ef68b52daebdcc16d88c96f8c5305 Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Mon, 20 Feb 2023 01:23:34 +0100 Subject: [PATCH 1/6] remove unused definitions --- definitions/3.0.0/bindingsObject.json | 24 ------------------------ definitions/3.0.0/external.json | 5 ----- 2 files changed, 29 deletions(-) delete mode 100644 definitions/3.0.0/bindingsObject.json delete mode 100644 definitions/3.0.0/external.json diff --git a/definitions/3.0.0/bindingsObject.json b/definitions/3.0.0/bindingsObject.json deleted file mode 100644 index cec5e0fc..00000000 --- a/definitions/3.0.0/bindingsObject.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "type": "object", - "additionalProperties": true, - "properties": { - "http": {}, - "ws": {}, - "amqp": {}, - "amqp1": {}, - "mqtt": {}, - "mqtt5": {}, - "kafka": {}, - "anypointmq": {}, - "nats": {}, - "jms": {}, - "sns": {}, - "sqs": {}, - "stomp": {}, - "redis": {}, - "ibmmq": {}, - "solace": {} - }, - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" -} \ No newline at end of file diff --git a/definitions/3.0.0/external.json b/definitions/3.0.0/external.json deleted file mode 100644 index c8aa2109..00000000 --- a/definitions/3.0.0/external.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/http://something.example.com/schemas/external.json", - "type": "string" - } \ No newline at end of file From 16ce1cc5d99f1566216158d1f9d9a403ad3edcf4 Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Mon, 20 Feb 2023 01:24:20 +0100 Subject: [PATCH 2/6] ensure consistency and fixed #339 --- definitions/3.0.0/channels.json | 8 +- definitions/3.0.0/message.json | 298 ++++++++++++++---------------- definitions/3.0.0/messages.json | 9 +- definitions/3.0.0/operation.json | 19 -- definitions/3.0.0/operations.json | 8 +- 5 files changed, 156 insertions(+), 186 deletions(-) diff --git a/definitions/3.0.0/channels.json b/definitions/3.0.0/channels.json index 2efd382e..a4f4e89d 100644 --- a/definitions/3.0.0/channels.json +++ b/definitions/3.0.0/channels.json @@ -2,8 +2,12 @@ "type": "object", "additionalProperties": { "oneOf": [ - { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, - { "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" } + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + } ] }, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/definitions/3.0.0/message.json b/definitions/3.0.0/message.json index 26bdb168..fa18b630 100644 --- a/definitions/3.0.0/message.json +++ b/definitions/3.0.0/message.json @@ -1,183 +1,157 @@ { "oneOf": [ { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" + } + } + } }, { - "oneOf": [ - { - "type": "object", - "required": [ - "oneOf" - ], - "additionalProperties": false, - "properties": { - "oneOf": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" + "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" }, - { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + "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" + } + ] }, - "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" - } - ] + "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" }, - "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" - } + { + "$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" ] }, - "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 - } - ] - } + { + "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" + } + ] + } } - ] + } } ], "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/definitions/3.0.0/messages.json b/definitions/3.0.0/messages.json index a57453e0..2522b7a1 100644 --- a/definitions/3.0.0/messages.json +++ b/definitions/3.0.0/messages.json @@ -1,7 +1,14 @@ { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" + } + ] }, "description": "JSON objects describing the messages being consumed and produced by the API.", "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/definitions/3.0.0/operation.json b/definitions/3.0.0/operation.json index aead26de..e8789805 100644 --- a/definitions/3.0.0/operation.json +++ b/definitions/3.0.0/operation.json @@ -28,25 +28,6 @@ }, { "$ref": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" - }, - { - "type": "array", - "items": [ - { - "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" - } - ] - }, - { - "type": "object", - "additionalItems": true - } - ] } ] } diff --git a/definitions/3.0.0/operations.json b/definitions/3.0.0/operations.json index 748982cc..7d44877f 100644 --- a/definitions/3.0.0/operations.json +++ b/definitions/3.0.0/operations.json @@ -2,8 +2,12 @@ "type": "object", "additionalProperties": { "oneOf": [ - { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, - { "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" } + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + } ] }, "$schema": "http://json-schema.org/draft-07/schema#", From bcd54d63415a6763c5fe4e418bc4bd97da87792d Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Mon, 20 Feb 2023 01:39:13 +0100 Subject: [PATCH 3/6] fixed tests --- definitions/3.0.0/channelMessages.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/definitions/3.0.0/channelMessages.json b/definitions/3.0.0/channelMessages.json index e15c044c..737404e1 100644 --- a/definitions/3.0.0/channelMessages.json +++ b/definitions/3.0.0/channelMessages.json @@ -1,7 +1,14 @@ { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" + } + ] }, "description": "A map of the messages that will be sent to this channel by any application at any time. **Every message sent to this channel MUST be valid against one, and only one, of the message objects defined in this map.**", "$schema": "http://json-schema.org/draft-07/schema#", From d5f81e5bc9dd4a1c2e62cc33e1dcf1f9ce3c3c3a Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Wed, 22 Feb 2023 19:52:37 +0100 Subject: [PATCH 4/6] remove unnecessary addtionalItems --- definitions/3.0.0/channel.json | 2 ++ definitions/3.0.0/info.json | 1 + 2 files changed, 3 insertions(+) diff --git a/definitions/3.0.0/channel.json b/definitions/3.0.0/channel.json index 22a3c4b6..c5e880d2 100644 --- a/definitions/3.0.0/channel.json +++ b/definitions/3.0.0/channel.json @@ -35,6 +35,7 @@ "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, + "additionalItems": false, "uniqueItems": true }, "tags": { @@ -49,6 +50,7 @@ } ] }, + "additionalItems": false, "uniqueItems": true }, "externalDocs": { diff --git a/definitions/3.0.0/info.json b/definitions/3.0.0/info.json index bf8c1491..dc4645f8 100644 --- a/definitions/3.0.0/info.json +++ b/definitions/3.0.0/info.json @@ -47,6 +47,7 @@ } ] }, + "additionalItems": false, "uniqueItems": true }, "externalDocs": { From 6fc968734d823a4bf7f5388cd8f84b34ac5074bb Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Wed, 22 Feb 2023 20:31:44 +0100 Subject: [PATCH 5/6] remove unnecessary addtionalItems --- definitions/3.0.0/channel.json | 2 -- definitions/3.0.0/info.json | 1 - 2 files changed, 3 deletions(-) diff --git a/definitions/3.0.0/channel.json b/definitions/3.0.0/channel.json index c5e880d2..22a3c4b6 100644 --- a/definitions/3.0.0/channel.json +++ b/definitions/3.0.0/channel.json @@ -35,7 +35,6 @@ "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, - "additionalItems": false, "uniqueItems": true }, "tags": { @@ -50,7 +49,6 @@ } ] }, - "additionalItems": false, "uniqueItems": true }, "externalDocs": { diff --git a/definitions/3.0.0/info.json b/definitions/3.0.0/info.json index dc4645f8..bf8c1491 100644 --- a/definitions/3.0.0/info.json +++ b/definitions/3.0.0/info.json @@ -47,7 +47,6 @@ } ] }, - "additionalItems": false, "uniqueItems": true }, "externalDocs": { From b021902ea74c01031ef732f461a12de485ebcf67 Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Thu, 16 Mar 2023 16:09:14 +0100 Subject: [PATCH 6/6] fixed double message reference --- definitions/3.0.0/message.json | 35 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/definitions/3.0.0/message.json b/definitions/3.0.0/message.json index 182240a0..d3fc8cd2 100644 --- a/definitions/3.0.0/message.json +++ b/definitions/3.0.0/message.json @@ -1,29 +1,22 @@ { "oneOf": [ { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "oneOf": [ - { - "type": "object", - "required": [ - "oneOf" - ], - "additionalProperties": false, - "properties": { - "oneOf": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" - } - } + "type": "object", + "required": [ + "oneOf" + ], + "additionalProperties": false, + "properties": { + "oneOf": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" } - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" } - ] + } + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageObject.json" } ], "$schema": "http://json-schema.org/draft-07/schema#",