From a5274e7bfafd0cba088885a07f11ce81e5ba716e Mon Sep 17 00:00:00 2001 From: Fran Mendez Date: Wed, 28 Sep 2022 09:08:58 +0200 Subject: [PATCH 1/3] feat!: add new channels and operations objects --- definitions/3.0.0/asyncapi.json | 3 +- .../3.0.0/{channelItem.json => channel.json} | 30 +++++++------- definitions/3.0.0/channelMessages.json | 9 +++++ definitions/3.0.0/channels.json | 10 ++--- definitions/3.0.0/operation.json | 18 ++++++--- definitions/3.0.0/operationTrait.json | 39 +------------------ definitions/3.0.0/operations.json | 11 ++++++ schemas/3.0.0.json | 6 +-- 8 files changed, 58 insertions(+), 68 deletions(-) rename definitions/3.0.0/{channelItem.json => channel.json} (53%) create mode 100644 definitions/3.0.0/channelMessages.json create mode 100644 definitions/3.0.0/operations.json diff --git a/definitions/3.0.0/asyncapi.json b/definitions/3.0.0/asyncapi.json index 703621ae..2021b833 100644 --- a/definitions/3.0.0/asyncapi.json +++ b/definitions/3.0.0/asyncapi.json @@ -5,8 +5,7 @@ "type": "object", "required": [ "asyncapi", - "info", - "channels" + "info" ], "additionalProperties": false, "patternProperties": { diff --git a/definitions/3.0.0/channelItem.json b/definitions/3.0.0/channel.json similarity index 53% rename from definitions/3.0.0/channelItem.json rename to definitions/3.0.0/channel.json index 5b469737..bd7d9e63 100644 --- a/definitions/3.0.0/channelItem.json +++ b/definitions/3.0.0/channel.json @@ -7,8 +7,12 @@ } }, "properties": { - "$ref": { - "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" + "address": { + "type": ["string", "null"], + "description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions." + }, + "messages": { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelMessages.json" }, "parameters": { "type": "object", @@ -28,20 +32,20 @@ }, "uniqueItems": true }, - "publish": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" - }, - "subscribe": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" - }, - "deprecated": { - "type": "boolean", - "default": false - }, "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" + }, + "uniqueItems": true + }, + "externalDocs": { + "$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/channelItem.json" + "$id": "http://asyncapi.com/definitions/3.0.0/channel.json" } \ No newline at end of file diff --git a/definitions/3.0.0/channelMessages.json b/definitions/3.0.0/channelMessages.json new file mode 100644 index 00000000..e15c044c --- /dev/null +++ b/definitions/3.0.0/channelMessages.json @@ -0,0 +1,9 @@ +{ + "type": "object", + "additionalProperties": { + "$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#", + "$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json" +} \ No newline at end of file diff --git a/definitions/3.0.0/channels.json b/definitions/3.0.0/channels.json index e1c540d6..2efd382e 100644 --- a/definitions/3.0.0/channels.json +++ b/definitions/3.0.0/channels.json @@ -1,12 +1,10 @@ { "type": "object", - "propertyNames": { - "type": "string", - "format": "uri-template", - "minLength": 1 - }, "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/channelItem.json" + "oneOf": [ + { "$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#", "$id": "http://asyncapi.com/definitions/3.0.0/channels.json" diff --git a/definitions/3.0.0/operation.json b/definitions/3.0.0/operation.json index d84c330d..d29882cf 100644 --- a/definitions/3.0.0/operation.json +++ b/definitions/3.0.0/operation.json @@ -6,7 +6,19 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "required": [ + "action", + "channel" + ], "properties": { + "action": { + "type": "string", + "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + "enum": ["send", "receive"] + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, "traits": { "type": "array", "items": { @@ -61,14 +73,8 @@ "externalDocs": { "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" }, - "operationId": { - "type": "string" - }, "bindings": { "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" - }, - "message": { - "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" } }, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/definitions/3.0.0/operationTrait.json b/definitions/3.0.0/operationTrait.json index 73dff058..962b89d1 100644 --- a/definitions/3.0.0/operationTrait.json +++ b/definitions/3.0.0/operationTrait.json @@ -1,41 +1,4 @@ { - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "properties": { - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "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" - }, - "operationId": { - "type": "string" - }, - "security": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json" - } - }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" - } - }, - "$schema": "http://json-schema.org/draft-07/schema#", + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json", "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" } \ No newline at end of file diff --git a/definitions/3.0.0/operations.json b/definitions/3.0.0/operations.json new file mode 100644 index 00000000..748982cc --- /dev/null +++ b/definitions/3.0.0/operations.json @@ -0,0 +1,11 @@ +{ + "type": "object", + "additionalProperties": { + "oneOf": [ + { "$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#", + "$id": "http://asyncapi.com/definitions/3.0.0/operations.json" +} \ No newline at end of file diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 6466df19..cea479ea 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -307,11 +307,11 @@ "minLength": 1 }, "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/channelItem.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" } }, - "http://asyncapi.com/definitions/3.0.0/channelItem.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/channelItem.json", + "http://asyncapi.com/definitions/3.0.0/channel.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/channel.json", "type": "object", "additionalProperties": false, "patternProperties": { From 1fbf71978296d327be3c8a56c3e65a9390a1598d Mon Sep 17 00:00:00 2001 From: Fran Mendez Date: Tue, 4 Oct 2022 22:25:38 +0200 Subject: [PATCH 2/3] Fixing regular expressions, adding missing bindingsObject.json file, and adding missing $schema keyword to operationTrait.json --- definitions/3.0.0/bindingsObject.json | 24 + definitions/3.0.0/channelBindingsObject.json | 2 +- definitions/3.0.0/messageBindingsObject.json | 2 +- .../3.0.0/operationBindingsObject.json | 2 +- definitions/3.0.0/operationTrait.json | 1 + definitions/3.0.0/serverBindingsObject.json | 2 +- schemas/3.0.0.json | 865 ++++++++++-------- 7 files changed, 510 insertions(+), 388 deletions(-) create mode 100644 definitions/3.0.0/bindingsObject.json diff --git a/definitions/3.0.0/bindingsObject.json b/definitions/3.0.0/bindingsObject.json new file mode 100644 index 00000000..cec5e0fc --- /dev/null +++ b/definitions/3.0.0/bindingsObject.json @@ -0,0 +1,24 @@ +{ + "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/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index 9448104e..11e3ea23 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -2,7 +2,7 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index b2105d2b..ad18b07f 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -2,7 +2,7 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index a08711d4..06f560fa 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -2,7 +2,7 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, diff --git a/definitions/3.0.0/operationTrait.json b/definitions/3.0.0/operationTrait.json index 962b89d1..e23385d9 100644 --- a/definitions/3.0.0/operationTrait.json +++ b/definitions/3.0.0/operationTrait.json @@ -1,4 +1,5 @@ { "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json", + "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" } \ No newline at end of file diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 9eb50779..a2389092 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -2,7 +2,7 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index cea479ea..2aecd76f 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -5,8 +5,7 @@ "type": "object", "required": [ "asyncapi", - "info", - "channels" + "info" ], "additionalProperties": false, "patternProperties": { @@ -221,7 +220,7 @@ } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } } }, @@ -275,10 +274,15 @@ "uniqueItems": true } }, - "http://asyncapi.com/definitions/3.0.0/bindingsObject.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json", + "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json", "type": "object", - "additionalProperties": true, + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, "properties": { "http": {}, "ws": {}, @@ -301,13 +305,15 @@ "http://asyncapi.com/definitions/3.0.0/channels.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channels.json", "type": "object", - "propertyNames": { - "type": "string", - "format": "uri-template", - "minLength": 1 - }, "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + } + ] } }, "http://asyncapi.com/definitions/3.0.0/channel.json": { @@ -320,8 +326,15 @@ } }, "properties": { - "$ref": { - "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" + "address": { + "type": [ + "string", + "null" + ], + "description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions." + }, + "messages": { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelMessages.json" }, "parameters": { "type": "object", @@ -341,46 +354,198 @@ }, "uniqueItems": true }, - "publish": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" - }, - "subscribe": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + "bindings": { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" }, - "deprecated": { - "type": "boolean", - "default": false + "tags": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + }, + "uniqueItems": true }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "externalDocs": { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" } } }, - "http://asyncapi.com/definitions/3.0.0/parameter.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/parameter.json", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } + "http://asyncapi.com/definitions/3.0.0/channelMessages.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json", + "type": "object", + "additionalProperties": { + "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" }, - "properties": { - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." - }, - "schema": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - "location": { - "type": "string", - "description": "A runtime expression that specifies the location of the parameter value", - "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + "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.**" + }, + "http://asyncapi.com/definitions/3.0.0/message.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/message.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, - "$ref": { - "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.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" + }, + "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": { + "$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": { + "$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 + } + ] + } + ] + } + } + } + } + ] } - } + ] }, "http://asyncapi.com/definitions/3.0.0/schema.json": { "$id": "http://asyncapi.com/definitions/3.0.0/schema.json", @@ -716,344 +881,35 @@ }, "oneOf": { "$ref": "#/definitions/schemaArray" - }, - "not": { - "$ref": "#" - } - }, - "default": true - }, - "http://asyncapi.com/definitions/3.0.0/externalDocs.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/externalDocs.json", - "type": "object", - "additionalProperties": false, - "description": "information about external documentation", - "required": [ - "url" - ], - "properties": { - "description": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - }, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - } - }, - "http://asyncapi.com/definitions/3.0.0/operation.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/operation.json", - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "properties": { - "traits": { - "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": "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 - } - ] - } - ] - } - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "security": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.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" - }, - "operationId": { - "type": "string" - }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" - }, - "message": { - "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" - } - } - }, - "http://asyncapi.com/definitions/3.0.0/operationTrait.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json", - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "properties": { - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "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" - }, - "operationId": { - "type": "string" - }, - "security": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json" - } - }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" - } - } - }, - "http://asyncapi.com/definitions/3.0.0/tag.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/tag.json", - "type": "object", - "additionalProperties": false, - "required": [ - "name" - ], - "properties": { - "name": { - "type": "string" - }, - "description": { - "type": "string" - }, - "externalDocs": { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" - } - }, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - } - }, - "http://asyncapi.com/definitions/3.0.0/message.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/message.json", - "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/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" - }, - "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": { - "$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": { - "$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/bindingsObject.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 - } - ] - } - ] - } - } - } - } - ] + }, + "not": { + "$ref": "#" } - ] + }, + "default": true + }, + "http://asyncapi.com/definitions/3.0.0/externalDocs.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/externalDocs.json", + "type": "object", + "additionalProperties": false, + "description": "information about external documentation", + "required": [ + "url" + ], + "properties": { + "description": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + } }, "http://asyncapi.com/definitions/3.0.0/correlationId.json": { "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json", @@ -1079,6 +935,58 @@ } } }, + "http://asyncapi.com/definitions/3.0.0/tag.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/tag.json", + "type": "object", + "additionalProperties": false, + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "externalDocs": { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + }, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} + } + }, "http://asyncapi.com/definitions/3.0.0/messageTrait.json": { "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.json", "type": "object", @@ -1159,8 +1067,62 @@ } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/parameter.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/parameter.json", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + }, + "schema": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the parameter value", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + }, + "$ref": { + "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } + }, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} } }, "http://asyncapi.com/definitions/3.0.0/components.json": { @@ -1821,6 +1783,141 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/parameter.json" }, "description": "JSON objects describing re-usable channel parameters." + }, + "http://asyncapi.com/definitions/3.0.0/operation.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operation.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "action", + "channel" + ], + "properties": { + "action": { + "type": "string", + "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + "enum": [ + "send", + "receive" + ] + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + "traits": { + "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": "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 + } + ] + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "security": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.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" + }, + "bindings": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} + } + }, + "http://asyncapi.com/definitions/3.0.0/bindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json", + "type": "object", + "additionalProperties": true, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} + } } }, "description": "!!Auto generated!! \n Do not manually edit. " From 348a08b9e09f8d8a9d17cb0aae6a6a2f76a12231 Mon Sep 17 00:00:00 2001 From: Fran Mendez Date: Tue, 4 Oct 2022 22:40:47 +0200 Subject: [PATCH 3/3] Add missing keywords and modify operationTrait.json --- definitions/3.0.0/asyncapi.json | 3 + definitions/3.0.0/operationTrait.json | 34 +++- schemas/3.0.0.json | 277 +++++++++++++++----------- 3 files changed, 201 insertions(+), 113 deletions(-) diff --git a/definitions/3.0.0/asyncapi.json b/definitions/3.0.0/asyncapi.json index 2021b833..4042edfc 100644 --- a/definitions/3.0.0/asyncapi.json +++ b/definitions/3.0.0/asyncapi.json @@ -38,6 +38,9 @@ "channels": { "$ref": "http://asyncapi.com/definitions/3.0.0/channels.json" }, + "operations": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operations.json" + }, "components": { "$ref": "http://asyncapi.com/definitions/3.0.0/components.json" }, diff --git a/definitions/3.0.0/operationTrait.json b/definitions/3.0.0/operationTrait.json index e23385d9..6ee4172a 100644 --- a/definitions/3.0.0/operationTrait.json +++ b/definitions/3.0.0/operationTrait.json @@ -1,5 +1,37 @@ { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "action": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/action" + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/channel" + }, + "summary": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" + }, + "description": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description" + }, + "security": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" + }, + "tags": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" + }, + "externalDocs": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" + }, + "bindings": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/bindings" + } + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" } \ No newline at end of file diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 2aecd76f..89749b62 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -38,6 +38,9 @@ "channels": { "$ref": "http://asyncapi.com/definitions/3.0.0/channels.json" }, + "operations": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operations.json" + }, "components": { "$ref": "http://asyncapi.com/definitions/3.0.0/components.json" }, @@ -1125,6 +1128,168 @@ "solace": {} } }, + "http://asyncapi.com/definitions/3.0.0/operations.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operations.json", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + } + ] + } + }, + "http://asyncapi.com/definitions/3.0.0/operation.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operation.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "action", + "channel" + ], + "properties": { + "action": { + "type": "string", + "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", + "enum": [ + "send", + "receive" + ] + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + "traits": { + "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": "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 + } + ] + } + ] + } + }, + "summary": { + "type": "string" + }, + "description": { + "type": "string" + }, + "security": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.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" + }, + "bindings": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/operationTrait.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "action": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/action" + }, + "channel": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/channel" + }, + "summary": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" + }, + "description": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description" + }, + "security": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" + }, + "tags": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" + }, + "externalDocs": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" + }, + "bindings": { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/bindings" + } + } + }, + "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "http": {}, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": {}, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": {} + } + }, "http://asyncapi.com/definitions/3.0.0/components.json": { "$id": "http://asyncapi.com/definitions/3.0.0/components.json", "type": "object", @@ -1784,118 +1949,6 @@ }, "description": "JSON objects describing re-usable channel parameters." }, - "http://asyncapi.com/definitions/3.0.0/operation.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/operation.json", - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "required": [ - "action", - "channel" - ], - "properties": { - "action": { - "type": "string", - "description": "Allowed values are send and receive. Use send when it's expected that the application will send a message to the given channel, and receive when the application should expect receiving messages from the given channel.", - "enum": [ - "send", - "receive" - ] - }, - "channel": { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - "traits": { - "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": "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 - } - ] - } - ] - } - }, - "summary": { - "type": "string" - }, - "description": { - "type": "string" - }, - "security": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.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" - }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" - } - } - }, - "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "properties": { - "http": {}, - "ws": {}, - "amqp": {}, - "amqp1": {}, - "mqtt": {}, - "mqtt5": {}, - "kafka": {}, - "anypointmq": {}, - "nats": {}, - "jms": {}, - "sns": {}, - "sqs": {}, - "stomp": {}, - "redis": {}, - "ibmmq": {}, - "solace": {} - } - }, "http://asyncapi.com/definitions/3.0.0/bindingsObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json", "type": "object",