From 8c2fc116ba16ec9df7e9367a998b6ad2e17b8bdd Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Fri, 8 Jul 2022 14:52:50 +0200 Subject: [PATCH 01/13] added versioning --- bindings/amqp/{ => 0.2.0}/channel.json | 3 +-- bindings/amqp/{ => 0.2.0}/message.json | 2 +- bindings/amqp/{ => 0.2.0}/operation.json | 2 +- definitions/3.0.0/channelBindingsObject.json | 8 +++++++- definitions/3.0.0/components.json | 8 ++++---- 5 files changed, 14 insertions(+), 9 deletions(-) rename bindings/amqp/{ => 0.2.0}/channel.json (98%) rename bindings/amqp/{ => 0.2.0}/message.json (94%) rename bindings/amqp/{ => 0.2.0}/operation.json (97%) diff --git a/bindings/amqp/channel.json b/bindings/amqp/0.2.0/channel.json similarity index 98% rename from bindings/amqp/channel.json rename to bindings/amqp/0.2.0/channel.json index 0ef1d292..5bdd13bb 100644 --- a/bindings/amqp/channel.json +++ b/bindings/amqp/0.2.0/channel.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/amqp/channel.json", + "$id": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json", "title": "AMQP channel bindings object", "description": "This object contains information about the channel representation in AMQP.", "type": "object", @@ -80,7 +80,6 @@ ], "description": "The version of this binding. If omitted, 'latest' MUST be assumed." } - }, "oneOf": [ { diff --git a/bindings/amqp/message.json b/bindings/amqp/0.2.0/message.json similarity index 94% rename from bindings/amqp/message.json rename to bindings/amqp/0.2.0/message.json index 5ec49ac6..1e388527 100644 --- a/bindings/amqp/message.json +++ b/bindings/amqp/0.2.0/message.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/amqp/message.json", + "$id": "http://asyncapi.com/bindings/amqp/0.2.0/message.json", "title": "AMQP message bindings object", "description": "This object contains information about the message representation in AMQP.", "type": "object", diff --git a/bindings/amqp/operation.json b/bindings/amqp/0.2.0/operation.json similarity index 97% rename from bindings/amqp/operation.json rename to bindings/amqp/0.2.0/operation.json index c01cd405..be8468da 100644 --- a/bindings/amqp/operation.json +++ b/bindings/amqp/0.2.0/operation.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/amqp/operation.json", + "$id": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json", "title": "AMQP operation bindings object", "description": "This object contains information about the operation representation in AMQP.", "type": "object", diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index 9448104e..0c23fb05 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -9,7 +9,13 @@ "properties": { "http": {}, "ws": {}, - "amqp": {}, + "amqp": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + } + ] + }, "amqp1": {}, "mqtt": {}, "mqtt5": {}, diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index 3e673074..fd2df606 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -71,25 +71,25 @@ "serverBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } }, "channelBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" } }, "operationBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" } }, "messageBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" } } }, From 69bdfdade886ea6a8cfaa51bf43b765b5d25589b Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Mon, 25 Jul 2022 15:14:36 +0200 Subject: [PATCH 02/13] add rest of the bindings --- bindings/amqp/0.2.0/channel.json | 4 +- bindings/amqp/0.2.0/message.json | 4 +- bindings/amqp/0.2.0/operation.json | 4 +- bindings/anypointmq/{ => 0.0.1}/channel.json | 6 +- bindings/anypointmq/{ => 0.0.1}/message.json | 8 +- bindings/http/{ => 0.1.0}/message.json | 8 +- bindings/http/{ => 0.1.0}/operation.json | 8 +- bindings/ibmmq/{ => 0.1.0}/channel.json | 6 +- bindings/ibmmq/{ => 0.1.0}/message.json | 6 +- bindings/ibmmq/{ => 0.1.0}/server.json | 6 +- bindings/kafka/{ => 0.1.0}/message.json | 8 +- bindings/kafka/{ => 0.1.0}/operation.json | 10 +- bindings/mqtt/{ => 0.1.0}/message.json | 6 +- bindings/mqtt/{ => 0.1.0}/operation.json | 6 +- bindings/mqtt/{ => 0.1.0}/server.json | 6 +- bindings/nats/{ => 0.1.0}/operation.json | 6 +- bindings/solace/{ => 0.2.0}/operation.json | 2 +- bindings/solace/{ => 0.2.0}/server.json | 6 +- bindings/websockets/{ => 0.1.0}/channel.json | 10 +- definitions/3.0.0/channelBindingsObject.json | 39 +- definitions/3.0.0/messageBindingsObject.json | 47 +- .../3.0.0/operationBindingsObject.json | 47 +- definitions/3.0.0/serverBindingsObject.json | 29 +- package-lock.json | 101 + package.json | 5 +- schemas/3.0.0.json | 1624 +++++++++++++++-- test/docs/3.0.0/streetlights-all.json | 319 ++++ test/schemas.js | 33 + tools/bundler/index.js | 41 +- tools/bundler/package-lock.json | 153 +- 30 files changed, 2300 insertions(+), 258 deletions(-) rename bindings/anypointmq/{ => 0.0.1}/channel.json (86%) rename bindings/anypointmq/{ => 0.0.1}/message.json (76%) rename bindings/http/{ => 0.1.0}/message.json (73%) rename bindings/http/{ => 0.1.0}/operation.json (87%) rename bindings/ibmmq/{ => 0.1.0}/channel.json (94%) rename bindings/ibmmq/{ => 0.1.0}/message.json (91%) rename bindings/ibmmq/{ => 0.1.0}/server.json (91%) rename bindings/kafka/{ => 0.1.0}/message.json (68%) rename bindings/kafka/{ => 0.1.0}/operation.json (66%) rename bindings/mqtt/{ => 0.1.0}/message.json (71%) rename bindings/mqtt/{ => 0.1.0}/operation.json (81%) rename bindings/mqtt/{ => 0.1.0}/server.json (90%) rename bindings/nats/{ => 0.1.0}/operation.json (76%) rename bindings/solace/{ => 0.2.0}/operation.json (97%) rename bindings/solace/{ => 0.2.0}/server.json (78%) rename bindings/websockets/{ => 0.1.0}/channel.json (75%) create mode 100644 test/docs/3.0.0/streetlights-all.json create mode 100644 test/schemas.js diff --git a/bindings/amqp/0.2.0/channel.json b/bindings/amqp/0.2.0/channel.json index 5bdd13bb..ae692fa1 100644 --- a/bindings/amqp/0.2.0/channel.json +++ b/bindings/amqp/0.2.0/channel.json @@ -6,8 +6,8 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/amqp/0.2.0/message.json b/bindings/amqp/0.2.0/message.json index 1e388527..3a213d19 100644 --- a/bindings/amqp/0.2.0/message.json +++ b/bindings/amqp/0.2.0/message.json @@ -6,8 +6,8 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/amqp/0.2.0/operation.json b/bindings/amqp/0.2.0/operation.json index be8468da..f39900f3 100644 --- a/bindings/amqp/0.2.0/operation.json +++ b/bindings/amqp/0.2.0/operation.json @@ -6,8 +6,8 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/anypointmq/channel.json b/bindings/anypointmq/0.0.1/channel.json similarity index 86% rename from bindings/anypointmq/channel.json rename to bindings/anypointmq/0.0.1/channel.json index 8a994e38..554a842b 100644 --- a/bindings/anypointmq/channel.json +++ b/bindings/anypointmq/0.0.1/channel.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/anypointmq/channel.json", + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json", "title": "Anypoint MQ channel bindings object", "description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/anypointmq/message.json b/bindings/anypointmq/0.0.1/message.json similarity index 76% rename from bindings/anypointmq/message.json rename to bindings/anypointmq/0.0.1/message.json index 3b4b0d68..16075b90 100644 --- a/bindings/anypointmq/message.json +++ b/bindings/anypointmq/0.0.1/message.json @@ -1,18 +1,18 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/anypointmq/message.json", + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json", "title": "Anypoint MQ message bindings object", "description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "headers": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." }, "bindingVersion": { diff --git a/bindings/http/message.json b/bindings/http/0.1.0/message.json similarity index 73% rename from bindings/http/message.json rename to bindings/http/0.1.0/message.json index 151e979f..7295151a 100644 --- a/bindings/http/message.json +++ b/bindings/http/0.1.0/message.json @@ -1,18 +1,18 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/http/message.json", + "$id": "http://asyncapi.com/bindings/http/0.1.0/message.json", "title": "HTTP message bindings object", "description": "This object contains information about the message representation in HTTP.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "headers": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." }, "bindingVersion": { diff --git a/bindings/http/operation.json b/bindings/http/0.1.0/operation.json similarity index 87% rename from bindings/http/operation.json rename to bindings/http/0.1.0/operation.json index d9329440..61119a7a 100644 --- a/bindings/http/operation.json +++ b/bindings/http/0.1.0/operation.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/http/operation.json", + "$id": "http://asyncapi.com/bindings/http/0.1.0/operation.json", "title": "HTTP operation bindings object", "description": "This object contains information about the operation representation in HTTP.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { @@ -35,7 +35,7 @@ "description": "When 'type' is 'request', this is the HTTP method, otherwise it MUST be ignored. Its value MUST be one of 'GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS', 'CONNECT', and 'TRACE'." }, "query": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a properties key." }, "bindingVersion": { diff --git a/bindings/ibmmq/channel.json b/bindings/ibmmq/0.1.0/channel.json similarity index 94% rename from bindings/ibmmq/channel.json rename to bindings/ibmmq/0.1.0/channel.json index 7dae8eac..85ea1a14 100644 --- a/bindings/ibmmq/channel.json +++ b/bindings/ibmmq/0.1.0/channel.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/ibmmq/channel.json", + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json", "title": "IBM MQ channel bindings object", "description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/ibmmq/message.json b/bindings/ibmmq/0.1.0/message.json similarity index 91% rename from bindings/ibmmq/message.json rename to bindings/ibmmq/0.1.0/message.json index 69cb0075..6cc28494 100644 --- a/bindings/ibmmq/message.json +++ b/bindings/ibmmq/0.1.0/message.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/ibmmq/message.json", + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", "title": "IBM MQ message bindings object", "description": "This object contains information about the message representation in IBM MQ.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/ibmmq/server.json b/bindings/ibmmq/0.1.0/server.json similarity index 91% rename from bindings/ibmmq/server.json rename to bindings/ibmmq/0.1.0/server.json index 576bf50a..20533493 100644 --- a/bindings/ibmmq/server.json +++ b/bindings/ibmmq/0.1.0/server.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/ibmmq/server.json", + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", "title": "IBM MQ server bindings object", "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/kafka/message.json b/bindings/kafka/0.1.0/message.json similarity index 68% rename from bindings/kafka/message.json rename to bindings/kafka/0.1.0/message.json index da96c722..85c3b946 100644 --- a/bindings/kafka/message.json +++ b/bindings/kafka/0.1.0/message.json @@ -1,17 +1,17 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/kafka/message.json", + "$id": "http://asyncapi.com/bindings/kafka/0.1.0/message.json", "title": "Kafka message bindings object", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "key": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "The message key." }, "bindingVersion": { diff --git a/bindings/kafka/operation.json b/bindings/kafka/0.1.0/operation.json similarity index 66% rename from bindings/kafka/operation.json rename to bindings/kafka/0.1.0/operation.json index 9ae5b11d..e37748ef 100644 --- a/bindings/kafka/operation.json +++ b/bindings/kafka/0.1.0/operation.json @@ -1,22 +1,22 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/kafka/operation.json", + "$id": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json", "title": "Kafka operation message bindings object", "description": "This object contains information about the operation representation in Kafka.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "groupId": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "Id of the consumer group." }, "clientId": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "Id of the consumer inside a consumer group." }, "bindingVersion": { diff --git a/bindings/mqtt/message.json b/bindings/mqtt/0.1.0/message.json similarity index 71% rename from bindings/mqtt/message.json rename to bindings/mqtt/0.1.0/message.json index de3211c2..6a36e454 100644 --- a/bindings/mqtt/message.json +++ b/bindings/mqtt/0.1.0/message.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/mqtt/message.json", + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json", "title": "MQTT message bindings object", "description": "This object contains information about the message representation in MQTT.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/mqtt/operation.json b/bindings/mqtt/0.1.0/operation.json similarity index 81% rename from bindings/mqtt/operation.json rename to bindings/mqtt/0.1.0/operation.json index f88cbb3a..57f5f718 100644 --- a/bindings/mqtt/operation.json +++ b/bindings/mqtt/0.1.0/operation.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/mqtt/operation.json", + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json", "title": "MQTT operation bindings object", "description": "This object contains information about the operation representation in MQTT.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/mqtt/server.json b/bindings/mqtt/0.1.0/server.json similarity index 90% rename from bindings/mqtt/server.json rename to bindings/mqtt/0.1.0/server.json index c379848a..3f98e13e 100644 --- a/bindings/mqtt/server.json +++ b/bindings/mqtt/0.1.0/server.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/mqtt/server.json", + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json", "title": "MQTT server bindings object", "description": "This object contains information about the server representation in MQTT.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/nats/operation.json b/bindings/nats/0.1.0/operation.json similarity index 76% rename from bindings/nats/operation.json rename to bindings/nats/0.1.0/operation.json index 9955a21e..9a75fd15 100644 --- a/bindings/nats/operation.json +++ b/bindings/nats/0.1.0/operation.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/nats/operation.json", + "$id": "http://asyncapi.com/bindings/nats/0.1.0/operation.json", "title": "NATS operation bindings object", "description": "This object contains information about the operation representation in NATS.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/solace/operation.json b/bindings/solace/0.2.0/operation.json similarity index 97% rename from bindings/solace/operation.json rename to bindings/solace/0.2.0/operation.json index 98aad7b8..d2b8d946 100644 --- a/bindings/solace/operation.json +++ b/bindings/solace/0.2.0/operation.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/solace/operation.json", + "$id": "http://asyncapi.com/bindings/solace/0.2.0/operation.json", "title": "Solace operation bindings object", "description": "This object contains information about the operation representation in Solace.", "type": "object", diff --git a/bindings/solace/server.json b/bindings/solace/0.2.0/server.json similarity index 78% rename from bindings/solace/server.json rename to bindings/solace/0.2.0/server.json index a87dedf2..5d34ba25 100644 --- a/bindings/solace/server.json +++ b/bindings/solace/0.2.0/server.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/solace/server.json", + "$id": "http://asyncapi.com/bindings/solace/0.2.0/server.json", "title": "Solace server bindings object", "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { diff --git a/bindings/websockets/channel.json b/bindings/websockets/0.1.0/channel.json similarity index 75% rename from bindings/websockets/channel.json rename to bindings/websockets/0.1.0/channel.json index 9e78dbd2..d01abd46 100644 --- a/bindings/websockets/channel.json +++ b/bindings/websockets/0.1.0/channel.json @@ -1,13 +1,13 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/websockets/channel.json", + "$id": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json", "title": "WebSockets channel bindings object", "description": "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/specificationExtension" + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { @@ -20,11 +20,11 @@ "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." }, "query": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." }, "headers": { - "$ref": "https://raw.githubusercontent.com/asyncapi/asyncapi-node/v2.7.7/schemas/2.0.0.json#/definitions/schema", + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." }, "bindingVersion": { diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index 0c23fb05..095a0e94 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -2,32 +2,61 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "http": {}, - "ws": {}, + "ws": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + ] + }, "amqp": { "oneOf": [ { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + } + ] + }, + "amqp1": { + "oneOf": [ + { + "description": "Latest binding", "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" } ] }, - "amqp1": {}, "mqtt": {}, "mqtt5": {}, "kafka": {}, - "anypointmq": {}, + "anypointmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + ] + }, "nats": {}, "jms": {}, "sns": {}, "sqs": {}, "stomp": {}, "redis": {}, - "ibmmq": {}, + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + ] + }, "solace": {} }, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index b2105d2b..a15ac325 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -2,26 +2,61 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { - "http": {}, + "http": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/http/0.1.0/message.json" + } + ] + }, "ws": {}, "amqp": {}, "amqp1": {}, - "mqtt": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json" + } + ] + }, "mqtt5": {}, - "kafka": {}, - "anypointmq": {}, + "kafka": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/message.json" + } + ] + }, + "anypointmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + ] + }, "nats": {}, "jms": {}, "sns": {}, "sqs": {}, "stomp": {}, "redis": {}, - "ibmmq": {}, + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + ] + }, "solace": {} }, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index a08711d4..9c21b5de 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -2,27 +2,62 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "http": {}, "ws": {}, - "amqp": {}, + "amqp": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json" + } + ] + }, "amqp1": {}, - "mqtt": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json" + } + ] + }, "mqtt5": {}, - "kafka": {}, + "kafka": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json" + } + ] + }, "anypointmq": {}, - "nats": {}, + "nats": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + ] + }, "jms": {}, "sns": {}, "sqs": {}, "stomp": {}, "redis": {}, "ibmmq": {}, - "solace": {} + "solace": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/operation.json" + } + ] + } }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 9eb50779..f3d2acc9 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" } }, @@ -11,7 +11,14 @@ "ws": {}, "amqp": {}, "amqp1": {}, - "mqtt": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json" + } + ] + }, "mqtt5": {}, "kafka": {}, "anypointmq": {}, @@ -21,8 +28,22 @@ "sqs": {}, "stomp": {}, "redis": {}, - "ibmmq": {}, - "solace": {} + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + ] + }, + "solace": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/server.json" + } + ] + } }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" diff --git a/package-lock.json b/package-lock.json index f45de9af..e3f2ee93 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@semantic-release/github": "7.2.3", "@semantic-release/npm": "^7.0.3", "@semantic-release/release-notes-generator": "^9.0.1", + "ajv": "^8.11.0", "conventional-changelog-conventionalcommits": "^4.2.3", "mocha": "^8.2.1", "nyc": "^15.1.0", @@ -779,6 +780,22 @@ "node": ">=8" } }, + "node_modules/ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -1686,6 +1703,12 @@ "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, "node_modules/fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -2770,6 +2793,12 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -7100,6 +7129,15 @@ "once": "^1.3.1" } }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -7383,6 +7421,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -10826,6 +10873,15 @@ "node": ">= 10.0.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", @@ -11897,6 +11953,18 @@ "indent-string": "^4.0.0" } }, + "ajv": { + "version": "8.11.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -12605,6 +12673,12 @@ } } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, "fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -13411,6 +13485,12 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -16550,6 +16630,12 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -16756,6 +16842,12 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -19233,6 +19325,15 @@ "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", diff --git a/package.json b/package.json index 3a71ea91..37dd59ad 100644 --- a/package.json +++ b/package.json @@ -37,13 +37,14 @@ }, "homepage": "https://github.com/asyncapi/spec-json-schemas#readme", "devDependencies": { - "mocha": "^8.2.1", - "nyc": "^15.1.0", "@semantic-release/commit-analyzer": "^8.0.1", "@semantic-release/github": "7.2.3", "@semantic-release/npm": "^7.0.3", "@semantic-release/release-notes-generator": "^9.0.1", + "ajv": "^8.11.0", "conventional-changelog-conventionalcommits": "^4.2.3", + "mocha": "^8.2.1", + "nyc": "^15.1.0", "semantic-release": "19.0.3" }, "release": { diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 6466df19..38082911 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -221,7 +221,7 @@ } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } } }, @@ -275,16 +275,28 @@ "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": {}, "amqp": {}, "amqp1": {}, - "mqtt": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json" + } + ] + }, "mqtt5": {}, "kafka": {}, "anypointmq": {}, @@ -294,10 +306,186 @@ "sqs": {}, "stomp": {}, "redis": {}, - "ibmmq": {}, - "solace": {} + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + ] + }, + "solace": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/server.json" + } + ] + } } }, + "http://asyncapi.com/bindings/mqtt/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json", + "title": "MQTT server bindings object", + "description": "This object contains information about the server representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "clientId": { + "type": "string", + "description": "The client identifier." + }, + "cleanSession": { + "type": "boolean", + "description": "Whether to create a persistent connection or not. When 'false', the connection will be persistent." + }, + "lastWill": { + "type": "object", + "description": "Last Will and Testament configuration.", + "properties": { + "topic": { + "type": "string", + "description": "The topic where the Last Will and Testament message will be sent." + }, + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + "message": { + "type": "string", + "description": "Last Will message." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + "keepAlive": { + "type": "integer", + "description": "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, + "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "groupId": "PRODCLSTR1", + "cipherSpec": "ANY_TLS12_OR_HIGHER", + "bindingVersion": "0.1.0" + }, + { + "groupId": "PRODCLSTR1", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/server.json": { + "$id": "http://asyncapi.com/bindings/solace/0.2.0/server.json", + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "msvVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.2.0" + } + ] + }, "http://asyncapi.com/definitions/3.0.0/channels.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channels.json", "type": "object", @@ -352,7 +540,7 @@ "default": false }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" } } }, @@ -814,7 +1002,7 @@ "type": "string" }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" }, "message": { "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" @@ -857,7 +1045,7 @@ } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" } } }, @@ -885,140 +1073,513 @@ } } }, - "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" + "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": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json" + } + ] }, - { + "amqp1": {}, + "mqtt": { "oneOf": [ { - "type": "object", - "required": [ - "oneOf" - ], - "additionalProperties": false, - "properties": { - "oneOf": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/message.json" - } - } - } - }, + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json" + } + ] + }, + "mqtt5": {}, + "kafka": { + "oneOf": [ { - "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", + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json" + } + ] + }, + "anypointmq": {}, + "nats": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + ] + }, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/operation.json" + } + ] + } + } + }, + "http://asyncapi.com/bindings/amqp/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json", + "title": "AMQP operation bindings object", + "description": "This object contains information about the operation representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "expiration": { + "type": "integer", + "minimum": 0, + "description": "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + "userId": { + "type": "string", + "description": "Identifies the user who has sent the message." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The routing keys the message should be routed to at the time of publishing." + }, + "priority": { + "type": "integer", + "description": "A priority for the message." + }, + "deliveryMode": { + "type": "integer", + "enum": [ + 1, + 2 + ], + "description": "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + "mandatory": { + "type": "boolean", + "description": "Whether the message is mandatory or not." + }, + "bcc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Like cc but consumers will not receive this information." + }, + "replyTo": { + "type": "string", + "description": "Name of the queue where the consumer should send the response." + }, + "timestamp": { + "type": "boolean", + "description": "Whether the message should include a timestamp or not." + }, + "ack": { + "type": "boolean", + "description": "Whether the consumer should ack the message or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "replyTo": "user.signedup", + "timestamp": true, + "ack": false, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json", + "title": "MQTT operation bindings object", + "description": "This object contains information about the operation representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "qos": { + "type": "integer", + "description": "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the message or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "qos": 2, + "retain": true, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json", + "title": "Kafka operation message bindings object", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/nats/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/nats/0.1.0/operation.json", + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "queue": { + "type": "string", + "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + "maxLength": 255 + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "queue": "MyCustomQueue", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/solace/0.2.0/operation.json", + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "examples": [ + { + "bindingVersion": "0.2.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "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/messageBindingsObject.json" + }, + "traits": { + "type": "array", "items": { "oneOf": [ { @@ -1051,33 +1612,331 @@ } } } - ] + ] + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/correlationId.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json", + "type": "object", + "required": [ + "location" + ], + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "description": { + "type": "string", + "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + }, + "location": { + "type": "string", + "description": "A runtime expression that specifies the location of the correlation ID", + "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + } + } + }, + "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": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/http/0.1.0/message.json" + } + ] + }, + "ws": {}, + "amqp": {}, + "amqp1": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json" + } + ] + }, + "mqtt5": {}, + "kafka": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/message.json" + } + ] + }, + "anypointmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + ] + }, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" + } + ] + }, + "solace": {} + } + }, + "http://asyncapi.com/bindings/http/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/http/0.1.0/message.json", + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json", + "title": "MQTT message bindings object", + "description": "This object contains information about the message representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.1.0/message.json", + "title": "Kafka message bindings object", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "key": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "The message key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "bindingVersion": "0.1.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json": { + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json", + "title": "Anypoint MQ message bindings object", + "description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "messageId": { + "type": "string" + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { + "required": [ + "headers" + ] + } + }, + { + "properties": { + "type": { + "const": "string" + } + }, + "not": { + "required": [ + "headers" + ] + } } - ] - }, - "http://asyncapi.com/definitions/3.0.0/correlationId.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json", - "type": "object", - "required": [ - "location" ], - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "properties": { - "description": { + "examples": [ + { "type": "string", - "description": "A optional description of the correlation ID. GitHub Flavored Markdown is allowed." + "bindingVersion": "0.1.0" }, - "location": { - "type": "string", - "description": "A runtime expression that specifies the location of the correlation ID", - "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + { + "type": "jms", + "description": "JMS stream message", + "bindingVersion": "0.1.0" } - } + ] }, "http://asyncapi.com/definitions/3.0.0/messageTrait.json": { "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.json", @@ -1159,10 +2018,441 @@ } }, "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/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": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + ] + }, + "amqp": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + } + ] + }, + "amqp1": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + } + ] + }, + "mqtt": {}, + "mqtt5": {}, + "kafka": {}, + "anypointmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + ] + }, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + ] + }, + "solace": {} } }, + "http://asyncapi.com/bindings/websockets/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json", + "title": "WebSockets channel bindings object", + "description": "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + "query": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "method": "POST", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.2.0/channel.json": { + "$id": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json", + "title": "AMQP channel bindings object", + "description": "This object contains information about the channel representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "is": { + "type": "string", + "enum": [ + "queue", + "routingKey" + ], + "description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + "exchange": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + "type": { + "type": "string", + "enum": [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + "description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + "durable": { + "type": "boolean", + "description": "Whether the exchange should survive broker restarts or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the exchange should be deleted when the last queue is unbound from it." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the exchange. Defaults to '/'." + } + }, + "description": "When is=routingKey, this object defines the exchange properties." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the queue. It MUST NOT exceed 255 characters long." + }, + "durable": { + "type": "boolean", + "description": "Whether the queue should survive broker restarts or not." + }, + "exclusive": { + "type": "boolean", + "description": "Whether the queue should be used only by one connection or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the queue should be deleted when the last consumer unsubscribes." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the queue. Defaults to '/'." + } + }, + "description": "When is=queue, this object defines the queue properties." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "oneOf": [ + { + "properties": { + "is": { + "const": "routingKey" + } + }, + "required": [ + "exchange" + ], + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "is": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "exchange" + ] + } + } + ], + "examples": [ + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.2.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json": { + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json", + "title": "Anypoint MQ channel bindings object", + "description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "exchange", + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signup-exchg", + "destinationType": "exchange", + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json", + "title": "IBM MQ channel bindings object", + "description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "destinationType": { + "type": "string", + "enum": [ + "topic", + "queue" + ], + "default": "topic", + "description": "Defines the type of AsyncAPI channel." + }, + "queue": { + "type": "object", + "description": "Defines the properties of a queue.", + "properties": { + "objectName": { + "type": "string", + "maxLength": 48, + "description": "Defines the name of the IBM MQ queue associated with the channel." + }, + "isPartitioned": { + "type": "boolean", + "default": false, + "description": "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + "exclusive": { + "type": "boolean", + "default": false, + "description": "Specifies if it is recommended to open the queue exclusively." + } + }, + "required": [ + "objectName" + ] + }, + "topic": { + "type": "object", + "description": "Defines the properties of a topic.", + "properties": { + "string": { + "type": "string", + "maxLength": 10240, + "description": "The value of the IBM MQ topic string to be used." + }, + "objectName": { + "type": "string", + "maxLength": 48, + "description": "The name of the IBM MQ topic object." + }, + "durablePermitted": { + "type": "boolean", + "default": true, + "description": "Defines if the subscription may be durable." + }, + "lastMsgRetained": { + "type": "boolean", + "default": false, + "description": "Defines if the last message published will be made available to new subscriptions." + } + } + }, + "maxMsgLength": { + "type": "integer", + "minimum": 0, + "maximum": 104857600, + "description": "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "const": "topic" + } + }, + "required": [ + "topic" + ], + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "destinationType": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "topic" + ] + } + } + ], + "examples": [ + { + "destinationType": "topic", + "topic": { + "objectName": "myTopicName" + }, + "bindingVersion": "0.1.0" + }, + { + "destinationType": "queue", + "queue": { + "objectName": "myQueueName", + "exclusive": true + }, + "bindingVersion": "0.1.0" + } + ] + }, "http://asyncapi.com/definitions/3.0.0/components.json": { "$id": "http://asyncapi.com/definitions/3.0.0/components.json", "type": "object", @@ -1237,25 +2527,25 @@ "serverBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } }, "channelBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" } }, "operationBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" } }, "messageBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" } } } diff --git a/test/docs/3.0.0/streetlights-all.json b/test/docs/3.0.0/streetlights-all.json new file mode 100644 index 00000000..59c27bdf --- /dev/null +++ b/test/docs/3.0.0/streetlights-all.json @@ -0,0 +1,319 @@ +{ + "asyncapi": "3.0.0", + "info": { + "title": "Streetlights All protocol API", + "version": "1.0.0", + "description": "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off 🌃\n* Dim a specific streetlight 😎\n* Receive real-time information about environmental lighting conditions 📈\n", + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0" + } + }, + "servers": { + "scram-kafka": { + "url": "test.mykafkacluster.org:18092", + "protocol": "kafka-secure", + "description": "Test broker secured with scramSha256", + "security": [ + { + "saslScram": [] + } + ] + }, + "mqtt": { + "url": "test.mosquitto.org:{port}", + "protocol": "mqtt", + "description": "Test broker", + "variables": { + "port": { + "description": "Secure connection (TLS) is available through port 8883.", + "default": "1883", + "enum": [ + "1883", + "8883" + ] + } + }, + "security": [ + { + "apiKey": [] + }, + { + "supportedOauthFlows": [ + "streetlights:on", + "streetlights:off", + "streetlights:dim" + ] + }, + { + "openIdConnectWellKnown": [] + } + ] + } + }, + "defaultContentType": "application/json", + "channels": { + "smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured": { + "description": "The topic on which measured values may be produced and consumed.", + "parameters": { + "streetlightId": { + "$ref": "#/components/parameters/streetlightId" + } + }, + "publish": { + "summary": "Inform about environmental lighting conditions of a particular streetlight.", + "operationId": "receiveLightMeasurement", + "traits": [ + { + "$ref": "#/components/operationTraits/all-protocols" + } + ], + "message": { + "$ref": "#/components/messages/lightMeasured" + } + } + }, + "smartylighting/streetlights/1/0/action/{streetlightId}/turn/on": { + "parameters": { + "streetlightId": { + "$ref": "#/components/parameters/streetlightId" + } + }, + "subscribe": { + "operationId": "turnOn", + "traits": [ + { + "$ref": "#/components/operationTraits/all-protocols" + } + ], + "message": { + "$ref": "#/components/messages/turnOnOff" + } + } + }, + "smartylighting/streetlights/1/0/action/{streetlightId}/turn/off": { + "parameters": { + "streetlightId": { + "$ref": "#/components/parameters/streetlightId" + } + }, + "subscribe": { + "operationId": "turnOff", + "traits": [ + { + "$ref": "#/components/operationTraits/all-protocols" + } + ], + "message": { + "$ref": "#/components/messages/turnOnOff" + } + } + }, + "smartylighting/streetlights/1/0/action/{streetlightId}/dim": { + "parameters": { + "streetlightId": { + "$ref": "#/components/parameters/streetlightId" + } + }, + "subscribe": { + "operationId": "dimLight", + "traits": [ + { + "$ref": "#/components/operationTraits/all-protocols" + } + ], + "message": { + "$ref": "#/components/messages/dimLight" + } + } + } + }, + "components": { + "messages": { + "lightMeasured": { + "name": "lightMeasured", + "title": "Light measured", + "summary": "Inform about environmental lighting conditions of a particular streetlight.", + "contentType": "application/json", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/lightMeasuredPayload" + } + }, + "turnOnOff": { + "name": "turnOnOff", + "title": "Turn on/off", + "summary": "Command a particular streetlight to turn the lights on or off.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/turnOnOffPayload" + } + }, + "dimLight": { + "name": "dimLight", + "title": "Dim light", + "summary": "Command a particular streetlight to dim the lights.", + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "payload": { + "$ref": "#/components/schemas/dimLightPayload" + } + } + }, + "schemas": { + "lightMeasuredPayload": { + "type": "object", + "properties": { + "lumens": { + "type": "integer", + "minimum": 0, + "description": "Light intensity measured in lumens." + }, + "sentAt": { + "$ref": "#/components/schemas/sentAt" + } + } + }, + "turnOnOffPayload": { + "type": "object", + "properties": { + "command": { + "type": "string", + "enum": [ + "on", + "off" + ], + "description": "Whether to turn on or off the light." + }, + "sentAt": { + "$ref": "#/components/schemas/sentAt" + } + } + }, + "dimLightPayload": { + "type": "object", + "properties": { + "percentage": { + "type": "integer", + "description": "Percentage to which the light should be dimmed to.", + "minimum": 0, + "maximum": 100 + }, + "sentAt": { + "$ref": "#/components/schemas/sentAt" + } + } + }, + "sentAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when the message was sent." + } + }, + "securitySchemes": { + "saslScram": { + "type": "scramSha256", + "description": "Provide your username and password for SASL/SCRAM authentication" + }, + "apiKey": { + "type": "apiKey", + "in": "user", + "description": "Provide your API key as the user and leave the password empty." + }, + "supportedOauthFlows": { + "type": "oauth2", + "description": "Flows to support OAuth 2.0", + "flows": { + "implicit": { + "authorizationUrl": "https://authserver.example/auth", + "scopes": { + "streetlights:on": "Ability to switch lights on", + "streetlights:off": "Ability to switch lights off", + "streetlights:dim": "Ability to dim the lights" + } + }, + "password": { + "tokenUrl": "https://authserver.example/token", + "scopes": { + "streetlights:on": "Ability to switch lights on", + "streetlights:off": "Ability to switch lights off", + "streetlights:dim": "Ability to dim the lights" + } + }, + "clientCredentials": { + "tokenUrl": "https://authserver.example/token", + "scopes": { + "streetlights:on": "Ability to switch lights on", + "streetlights:off": "Ability to switch lights off", + "streetlights:dim": "Ability to dim the lights" + } + }, + "authorizationCode": { + "authorizationUrl": "https://authserver.example/auth", + "tokenUrl": "https://authserver.example/token", + "refreshUrl": "https://authserver.example/refresh", + "scopes": { + "streetlights:on": "Ability to switch lights on", + "streetlights:off": "Ability to switch lights off", + "streetlights:dim": "Ability to dim the lights" + } + } + } + }, + "openIdConnectWellKnown": { + "type": "openIdConnect", + "openIdConnectUrl": "https://authserver.example/.well-known" + } + }, + "parameters": { + "streetlightId": { + "description": "The ID of the streetlight.", + "schema": { + "type": "string" + } + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + }, + "operationTraits": { + "all-protocols": { + "bindings": { + "mqtt": { + "qos": 1 + }, + "kafka": { + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] + } + } + } + } + } + } +} \ No newline at end of file diff --git a/test/schemas.js b/test/schemas.js new file mode 100644 index 00000000..562362d8 --- /dev/null +++ b/test/schemas.js @@ -0,0 +1,33 @@ +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); +const Ajv = require("ajv") +const versionsToTest = [ + { + version: '3.0.0' + } +] + +it('Versions should accurately validate documents', () => { + for (const versionToTest of versionsToTest) { + const version = versionToTest.version; + const asyncapi = require('..'); + const schema = asyncapi[version]; + delete schema.definitions['http://json-schema.org/draft-07/schema']; + const ajv = new Ajv({ + jsonPointers: true, + allErrors: true, + schemaId: '$id', + logger: false, + validateFormats: false, + strict: false + }); + const documentPaths = fs.readdirSync(path.resolve(__dirname, `./docs/${version}`)).map((pathToDoc) => {return path.resolve(__dirname, `./docs/${version}/${pathToDoc}`)}); + for (const documentPath of documentPaths) { + const document = require(documentPath); + const validate = ajv.compile(schema) + const valid = validate(document) + assert(valid === true, 'Document must be validated correctly: ' + JSON.stringify(validate.errors, null, 4)); + } + } +}); diff --git a/tools/bundler/index.js b/tools/bundler/index.js index 3733af64..880686fe 100644 --- a/tools/bundler/index.js +++ b/tools/bundler/index.js @@ -1,10 +1,41 @@ const path = require('path'); const fs = require('fs'); const definitionsDirectory = path.resolve(__dirname, '../../definitions'); +const bindingsDirectory = path.resolve(__dirname, '../../bindings'); const outputDirectory = path.resolve(__dirname, '../../schemas'); console.log(`Looking for separate definitions in the following directory: ${definitionsDirectory}`); +console.log(`Looking for binding version schemas in the following directory: ${bindingsDirectory}`); console.log(`Using the following output directory: ${outputDirectory}`); +/** + * Function to load all the core AsyncAPI spec definition (except the root asyncapi schema, as that will be loaded later) into the bundler. + */ +async function loadDefinitions(bundler, versionDir) { + const definitions = await fs.promises.readdir(versionDir); + const definitionFiles = definitions.filter((value) => {return !value.includes('asyncapi')}).map((file) => fs.readFileSync(path.resolve(versionDir, file))); + const definitionJson = definitionFiles.map((file) => JSON.parse(file)); + for (const jsonFile of definitionJson) { + bundler.add(jsonFile); + } +} +/** + * Function to load all the binding version schemas into the bundler + */ +async function loadBindings(bundler) { + const bindingDirectories = await fs.promises.readdir(bindingsDirectory); + for (const bindingDirectory of bindingDirectories) { + const bindingVersionDirectories = await fs.promises.readdir(path.resolve(bindingsDirectory, bindingDirectory)); + const bindingVersionDirectoriesFiltered = bindingVersionDirectories.filter((file) => fs.lstatSync(path.resolve(bindingsDirectory, bindingDirectory, file)).isDirectory()); + for (const bindingVersionDirectory of bindingVersionDirectoriesFiltered) { + const bindingFiles = await fs.promises.readdir(path.resolve(bindingsDirectory, bindingDirectory, bindingVersionDirectory)); + const bindingFilesFiltered = bindingFiles.filter((bindingFile) => path.extname(bindingFile) === '.json').map((bindingFile) => path.resolve(bindingsDirectory, bindingDirectory, bindingVersionDirectory, bindingFile)); + for (const bindingFile of bindingFilesFiltered) { + const bindingFileContent = require(bindingFile); + bundler.add(bindingFileContent); + } + } + } +} /** * When run, go through all versions that have split definitions and bundles them together. */ @@ -20,12 +51,8 @@ console.log(`Using the following output directory: ${outputDirectory}`); try{ console.log(`Bundling the following version together: ${version}`); const versionDir = path.resolve(definitionsDirectory, version); - const definitions = await fs.promises.readdir(versionDir); - const definitionFiles = definitions.filter((value) => {return !value.includes('asyncapi')}).map((file) => fs.readFileSync(path.resolve(versionDir, file))); - const definitionJson = definitionFiles.map((file) => JSON.parse(file)); - for (const jsonFile of definitionJson) { - Bundler.add(jsonFile); - } + await loadDefinitions(Bundler, versionDir); + await loadBindings(Bundler); const filePathToBundle = `file://${versionDir}/asyncapi.json`; const fileToBundle = await Bundler.get(filePathToBundle); const bundledSchema = await Bundler.bundle(fileToBundle); @@ -33,7 +60,7 @@ console.log(`Using the following output directory: ${outputDirectory}`); const outputFile = path.resolve(outputDirectory, `${version}.json`); console.log(`Writing the bundled file to: ${outputFile}`); await fs.promises.writeFile(outputFile, JSON.stringify(bundledSchema, null, 4)); - }catch(e) { + }catch(e) { console.log(e); } } diff --git a/tools/bundler/package-lock.json b/tools/bundler/package-lock.json index 6fcc6076..e9a3a017 100644 --- a/tools/bundler/package-lock.json +++ b/tools/bundler/package-lock.json @@ -1,8 +1,159 @@ { "name": "bundler", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "bundler", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "@hyperjump/json-schema-bundle": "0.1.3" + } + }, + "node_modules/@hyperjump/json-pointer": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-0.9.1.tgz", + "integrity": "sha512-tiDl/9MOkkiUQ5t+wq4PhtPghgWmFyBwU9Q6xRkXksg2s/6GNxNPcO/MzOjJoDAeCY1XXajNUIkco7wvhNmlOA==", + "dependencies": { + "just-curry-it": "^3.2.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/json-schema": { + "version": "0.18.3", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-0.18.3.tgz", + "integrity": "sha512-HKrrsuJOlYdqpHEr/eRU99LCiAe8ZH4LUkQOQOMa/P8pNSgs4FQHMKy3sgkmgLSgdmQbRX2/hA+yn2Ts/gS0lA==", + "dependencies": { + "@hyperjump/json-schema-core": "^0.23.4", + "fastest-stable-stringify": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/json-schema-bundle": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-bundle/-/json-schema-bundle-0.1.3.tgz", + "integrity": "sha512-UjmmtyIgaMXRXKmkJDQhvGAQFSfaPYBRue4tk3qeISrD468vziCWI2Km0RgfeXVxgy5xgqEPyi9DLXUqD4KWDQ==", + "dependencies": { + "@hyperjump/json-schema": "^0.18.3", + "uuid": "^8.3.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/json-schema-core": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-core/-/json-schema-core-0.23.4.tgz", + "integrity": "sha512-rHORA3qPk2JKOJOgwgXzGkMnad0neoPiHK8tPrITNxCcVM+AwPkTK+ABogNhbFG4lipWVF4gB3XHJ2qxfQuSAw==", + "dependencies": { + "@hyperjump/json-pointer": "^0.9.1", + "@hyperjump/pact": "^0.2.0", + "content-type": "^1.0.4", + "node-fetch": "^2.6.5", + "pubsub-js": "^1.9.1", + "url-resolve-browser": "^1.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/pact": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-0.2.0.tgz", + "integrity": "sha512-RHt0XRFsADXbqopurGZfCUNL7mPc0695TD2HNDqs4RCK5Db/1lDU2Bhk9EsyFmCBE9N1/boyvdKWjT1UYHIebg==", + "dependencies": { + "just-curry-it": "^3.1.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fastest-stable-stringify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz", + "integrity": "sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q==" + }, + "node_modules/just-curry-it": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-3.2.1.tgz", + "integrity": "sha512-Q8206k8pTY7krW32cdmPsP+DqqLgWx/hYPSj9/+7SYqSqz7UuwPbfSe07lQtvuuaVyiSJveXk0E5RydOuWwsEg==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/pubsub-js": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz", + "integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/url-resolve-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/url-resolve-browser/-/url-resolve-browser-1.2.0.tgz", + "integrity": "sha512-L9PBPnlKNDFzt9ElK4br8I8Tufdm1xgv1GhMeiP7ZC87x0b7mr+4vSh13kmPq5km80JKX+UD2BeEFTCrFZ6xDA==" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + }, "dependencies": { "@hyperjump/json-pointer": { "version": "0.9.1", From f5993322c8fe7d8f7eb9e198493d2e4f36564839 Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Sun, 6 Nov 2022 02:43:24 +0100 Subject: [PATCH 03/13] add solace version 0.3.0 bindings --- bindings/solace/0.3.0/operation.json | 114 +++++++++++++++++++++++++++ bindings/solace/0.3.0/server.json | 32 ++++++++ 2 files changed, 146 insertions(+) create mode 100644 bindings/solace/0.3.0/operation.json create mode 100644 bindings/solace/0.3.0/server.json diff --git a/bindings/solace/0.3.0/operation.json b/bindings/solace/0.3.0/operation.json new file mode 100644 index 00000000..477962f7 --- /dev/null +++ b/bindings/solace/0.3.0/operation.json @@ -0,0 +1,114 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/solace/0.3.0/operation.json", + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "examples": [ + { + "bindingVersion": "0.3.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] +} diff --git a/bindings/solace/0.3.0/server.json b/bindings/solace/0.3.0/server.json new file mode 100644 index 00000000..c4755d29 --- /dev/null +++ b/bindings/solace/0.3.0/server.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/solace/0.3.0/server.json", + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.3.0" + } + ] +} From 2ad0256a538fdf49328286121fc224bb121229a2 Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Sun, 6 Nov 2022 02:48:47 +0100 Subject: [PATCH 04/13] add codeowners for bindings schemas as bindings repo layed out --- CODEOWNERS | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 23129c54..91d5e9f7 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -6,4 +6,12 @@ # The default owners are automatically added as reviewers when you open a pull request unless different owners are specified in the file. -* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve \ No newline at end of file +* @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve + + +/bindings/anypointmq/ @GeraldLoeffler +/bindings/ibmmq/ @rcoppen +/bindings/kafka/ @lbroudoux @dalelane +/bindings/googlepubsub/ @whitlockjc +/bindings/solace/ @damaru-inc @CameronRushton +/bindings/*.json @KhudaDad414 \ No newline at end of file From 7a93242b8613cea1949dccd29164f82900447c5b Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Sun, 6 Nov 2022 02:48:56 +0100 Subject: [PATCH 05/13] add google pubsub bindings --- bindings/googlepubsub/0.1.0/channel.json | 88 ++++++++++++++++++++++++ bindings/googlepubsub/0.1.0/message.json | 55 +++++++++++++++ 2 files changed, 143 insertions(+) create mode 100644 bindings/googlepubsub/0.1.0/channel.json create mode 100644 bindings/googlepubsub/0.1.0/message.json diff --git a/bindings/googlepubsub/0.1.0/channel.json b/bindings/googlepubsub/0.1.0/channel.json new file mode 100644 index 00000000..411bc174 --- /dev/null +++ b/bindings/googlepubsub/0.1.0/channel.json @@ -0,0 +1,88 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json", + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the channel representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + }, + "labels": { + "type": "object" + }, + "messageRetentionDuration": { + "type": "string" + }, + "messageStoragePolicy": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowedPersistenceRegions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "schemaSettings": { + "type": "object", + "additionalItems": false, + "properties": { + "encoding": { + "type": "string" + }, + "firstRevisionId": { + "type": "string" + }, + "lastRevisionId": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "encoding", + "name" + ] + }, + "topic": { + "type": "string" + } + }, + "required": [ + "schemaSettings", + "topic" + ], + "examples": [ + { + "labels": { + "label1": "value1", + "label2": "value2" + }, + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-east1" + ] + }, + "schemaSettings": { + "encoding": "json", + "name": "projects/your-project-id/schemas/your-schema" + } + } + ] +} \ No newline at end of file diff --git a/bindings/googlepubsub/0.1.0/message.json b/bindings/googlepubsub/0.1.0/message.json new file mode 100644 index 00000000..87f84860 --- /dev/null +++ b/bindings/googlepubsub/0.1.0/message.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.json", + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the message representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + }, + "attributes": { + "type": "object" + }, + "orderingKey": { + "type": "string" + }, + "schema": { + "type": "object", + "additionalItems": false, + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": ["name", "type"] + } + }, + "examples": [ + { + "schema": { + "name": "projects/your-project-id/schemas/your-avro-schema-id", + "type": "avro" + } + }, + { + "schema": { + "name": "projects/your-project-id/schemas/your-protobuf-schema-id", + "type": "protobuf" + } + } + ] +} \ No newline at end of file From 969bc39a69d5bc4a337b668a53e17a8ba8dd8da6 Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Sun, 6 Nov 2022 02:52:32 +0100 Subject: [PATCH 06/13] add kafka 0.3.0 bindings --- bindings/kafka/0.3.0/channel.json | 46 ++++++++++++++++++++++ bindings/kafka/0.3.0/message.json | 61 +++++++++++++++++++++++++++++ bindings/kafka/0.3.0/operation.json | 48 +++++++++++++++++++++++ bindings/kafka/0.3.0/server.json | 38 ++++++++++++++++++ 4 files changed, 193 insertions(+) create mode 100644 bindings/kafka/0.3.0/channel.json create mode 100644 bindings/kafka/0.3.0/message.json create mode 100644 bindings/kafka/0.3.0/operation.json create mode 100644 bindings/kafka/0.3.0/server.json diff --git a/bindings/kafka/0.3.0/channel.json b/bindings/kafka/0.3.0/channel.json new file mode 100644 index 00000000..a503c81d --- /dev/null +++ b/bindings/kafka/0.3.0/channel.json @@ -0,0 +1,46 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.3.0" + } + ] + } + \ No newline at end of file diff --git a/bindings/kafka/0.3.0/message.json b/bindings/kafka/0.3.0/message.json new file mode 100644 index 00000000..6f8f4a0b --- /dev/null +++ b/bindings/kafka/0.3.0/message.json @@ -0,0 +1,61 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/message.json", + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "key": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": ["header", "payload"] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.3.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.3.0" + } + ] +} diff --git a/bindings/kafka/0.3.0/operation.json b/bindings/kafka/0.3.0/operation.json new file mode 100644 index 00000000..27b73eda --- /dev/null +++ b/bindings/kafka/0.3.0/operation.json @@ -0,0 +1,48 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer group." + }, + "clientId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer inside a consumer group." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.3.0" + } + ] +} diff --git a/bindings/kafka/0.3.0/server.json b/bindings/kafka/0.3.0/server.json new file mode 100644 index 00000000..86579101 --- /dev/null +++ b/bindings/kafka/0.3.0/server.json @@ -0,0 +1,38 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/kafka/0.1.0/server.json", + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.3.0" + } + ] + } + \ No newline at end of file From f6a0eb0b3c4db737a75ff2da60247d37f93dbd9d Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Sun, 6 Nov 2022 03:11:44 +0100 Subject: [PATCH 07/13] add new bindings to 3.0.0 definition --- definitions/3.0.0/channelBindingsObject.json | 19 +++++++++++++++++-- definitions/3.0.0/messageBindingsObject.json | 15 +++++++++++++-- .../3.0.0/operationBindingsObject.json | 13 ++++++++++--- definitions/3.0.0/serverBindingsObject.json | 17 ++++++++++++++--- 4 files changed, 54 insertions(+), 10 deletions(-) diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index 095a0e94..b5ddd0a2 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -34,7 +34,14 @@ }, "mqtt": {}, "mqtt5": {}, - "kafka": {}, + "kafka": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" + } + ] + }, "anypointmq": { "oneOf": [ { @@ -57,7 +64,15 @@ } ] }, - "solace": {} + "solace": {}, + "googlepubsub": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json" + } + ] + } }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index a15ac325..fe4c930b 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -30,8 +30,11 @@ "kafka": { "oneOf": [ { - "description": "Latest binding", "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/message.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/message.json" } ] }, @@ -57,7 +60,15 @@ } ] }, - "solace": {} + "solace": {}, + "googlepubsub": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.json" + } + ] + } }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index 9c21b5de..576e1ef5 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -30,8 +30,11 @@ "kafka": { "oneOf": [ { - "description": "Latest binding", "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" } ] }, @@ -53,11 +56,15 @@ "solace": { "oneOf": [ { - "description": "Latest binding", "$ref": "http://asyncapi.com/bindings/solace/0.2.0/operation.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.3.0/operation.json" } ] - } + }, + "googlepubsub": {} }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index f3d2acc9..6389a768 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -20,7 +20,14 @@ ] }, "mqtt5": {}, - "kafka": {}, + "kafka": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/server.json" + } + ] + }, "anypointmq": {}, "nats": {}, "jms": {}, @@ -39,11 +46,15 @@ "solace": { "oneOf": [ { - "description": "Latest binding", "$ref": "http://asyncapi.com/bindings/solace/0.2.0/server.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.3.0/server.json" } ] - } + }, + "googlepubsub": {} }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" From 466c2e57293a89b1f3450a766238debb3634edb2 Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Sun, 6 Nov 2022 03:17:01 +0100 Subject: [PATCH 08/13] fixed remaining bundle errors --- bindings/googlepubsub/0.1.0/channel.json | 2 +- bindings/googlepubsub/0.1.0/message.json | 2 +- bindings/kafka/0.3.0/channel.json | 2 +- bindings/kafka/0.3.0/message.json | 2 +- bindings/kafka/0.3.0/operation.json | 2 +- bindings/kafka/0.3.0/server.json | 4 +- schemas/2.5.0.json | 12 +- schemas/3.0.0.json | 2087 ++++++++++++++++++++-- tools/bundler/package-lock.json | 153 +- 9 files changed, 1908 insertions(+), 358 deletions(-) diff --git a/bindings/googlepubsub/0.1.0/channel.json b/bindings/googlepubsub/0.1.0/channel.json index 411bc174..6a8105f5 100644 --- a/bindings/googlepubsub/0.1.0/channel.json +++ b/bindings/googlepubsub/0.1.0/channel.json @@ -6,7 +6,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/bindings/googlepubsub/0.1.0/message.json b/bindings/googlepubsub/0.1.0/message.json index 87f84860..08f815ff 100644 --- a/bindings/googlepubsub/0.1.0/message.json +++ b/bindings/googlepubsub/0.1.0/message.json @@ -6,7 +6,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/bindings/kafka/0.3.0/channel.json b/bindings/kafka/0.3.0/channel.json index a503c81d..91946b2a 100644 --- a/bindings/kafka/0.3.0/channel.json +++ b/bindings/kafka/0.3.0/channel.json @@ -6,7 +6,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/bindings/kafka/0.3.0/message.json b/bindings/kafka/0.3.0/message.json index 6f8f4a0b..8d94ac9c 100644 --- a/bindings/kafka/0.3.0/message.json +++ b/bindings/kafka/0.3.0/message.json @@ -5,7 +5,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/bindings/kafka/0.3.0/operation.json b/bindings/kafka/0.3.0/operation.json index 27b73eda..f7e30e29 100644 --- a/bindings/kafka/0.3.0/operation.json +++ b/bindings/kafka/0.3.0/operation.json @@ -6,7 +6,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/bindings/kafka/0.3.0/server.json b/bindings/kafka/0.3.0/server.json index 86579101..4f8b3c7a 100644 --- a/bindings/kafka/0.3.0/server.json +++ b/bindings/kafka/0.3.0/server.json @@ -1,12 +1,12 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/kafka/0.1.0/server.json", + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/server.json", "title": "Server Schema", "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", "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/2.5.0.json b/schemas/2.5.0.json index d2070555..0d83b1a9 100644 --- a/schemas/2.5.0.json +++ b/schemas/2.5.0.json @@ -437,9 +437,6 @@ "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/2.5.0/ReferenceObject.json" } } }, @@ -1832,7 +1829,14 @@ "$id": "http://asyncapi.com/definitions/2.5.0/parameters.json", "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/2.5.0/parameter.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/2.5.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/2.5.0/parameter.json" + } + ] }, "description": "JSON objects describing re-usable channel parameters." } diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 89749b62..b85530e6 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -291,9 +291,23 @@ "ws": {}, "amqp": {}, "amqp1": {}, - "mqtt": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json" + } + ] + }, "mqtt5": {}, - "kafka": {}, + "kafka": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/server.json" + } + ] + }, "anypointmq": {}, "nats": {}, "jms": {}, @@ -301,10 +315,257 @@ "sqs": {}, "stomp": {}, "redis": {}, - "ibmmq": {}, - "solace": {} + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json" + } + ] + }, + "solace": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/server.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.3.0/server.json" + } + ] + }, + "googlepubsub": {} } }, + "http://asyncapi.com/bindings/mqtt/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json", + "title": "MQTT server bindings object", + "description": "This object contains information about the server representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "clientId": { + "type": "string", + "description": "The client identifier." + }, + "cleanSession": { + "type": "boolean", + "description": "Whether to create a persistent connection or not. When 'false', the connection will be persistent." + }, + "lastWill": { + "type": "object", + "description": "Last Will and Testament configuration.", + "properties": { + "topic": { + "type": "string", + "description": "The topic where the Last Will and Testament message will be sent." + }, + "qos": { + "type": "integer", + "enum": [ + 0, + 1, + 2 + ], + "description": "Defines how hard the broker/client will try to ensure that the Last Will and Testament message is received. Its value MUST be either 0, 1 or 2." + }, + "message": { + "type": "string", + "description": "Last Will message." + }, + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the Last Will and Testament message or not." + } + } + }, + "keepAlive": { + "type": "integer", + "description": "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false + }, + "keepAlive": 60, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/server.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/server.json", + "title": "Server Schema", + "description": "This object contains server connection information to a Kafka broker. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "schemaRegistryUrl": { + "type": "string", + "description": "API URL for the Schema Registry used when producing Kafka messages (if a Schema Registry was used)." + }, + "schemaRegistryVendor": { + "type": "string", + "description": "The vendor of the Schema Registry and Kafka serdes library that should be used." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "schemaRegistryUrl": "https://my-schema-registry.com", + "schemaRegistryVendor": "confluent", + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, + "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "groupId": "PRODCLSTR1", + "cipherSpec": "ANY_TLS12_OR_HIGHER", + "bindingVersion": "0.1.0" + }, + { + "groupId": "PRODCLSTR1", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/server.json": { + "$id": "http://asyncapi.com/bindings/solace/0.2.0/server.json", + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "msvVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/server.json": { + "$id": "http://asyncapi.com/bindings/solace/0.3.0/server.json", + "title": "Solace server bindings object", + "description": "This object contains server connection information about the Solace broker. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "msgVpn": { + "type": "string", + "description": "The name of the Virtual Private Network to connect to on the Solace broker." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding." + } + }, + "examples": [ + { + "msgVpn": "ProdVPN", + "bindingVersion": "0.3.0" + } + ] + }, "http://asyncapi.com/definitions/3.0.0/channels.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channels.json", "type": "object", @@ -972,110 +1233,75 @@ } }, "properties": { - "http": {}, + "http": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/http/0.1.0/message.json" + } + ] + }, "ws": {}, "amqp": {}, "amqp1": {}, - "mqtt": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json" + } + ] + }, "mqtt5": {}, - "kafka": {}, - "anypointmq": {}, + "kafka": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/message.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/message.json" + } + ] + }, + "anypointmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json" + } + ] + }, "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", - "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" - }, + "ibmmq": { + "oneOf": [ { - "properties": { - "type": { - "const": "object" - } - } + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json" } ] }, - "messageId": { - "type": "string" - }, - "correlationId": { + "solace": {}, + "googlepubsub": { "oneOf": [ { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/correlationId.json" + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.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" - } - }, - "bindings": { - "$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", + "http://asyncapi.com/bindings/http/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/http/0.1.0/message.json", + "title": "HTTP message bindings object", + "description": "This object contains information about the message representation in HTTP.", + "type": "object", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -1083,25 +1309,951 @@ } }, "properties": { - "description": { - "type": "string", - "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "\tA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type 'object' and have a 'properties' key." }, - "schema": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "Content-Type": { + "type": "string", + "enum": [ + "application/json" + ] + } + } + }, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/mqtt/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json", + "title": "MQTT message bindings object", + "description": "This object contains information about the message representation in MQTT.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.1.0/message.json", + "title": "Kafka message bindings object", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "key": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "The message key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "bindingVersion": "0.1.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/message.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/message.json", + "title": "Message Schema", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "key": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "The message key." + }, + "schemaIdLocation": { + "type": "string", + "description": "If a Schema Registry is used when performing this operation, tells where the id of schema is stored.", + "enum": [ + "header", + "payload" + ] + }, + "schemaIdPayloadEncoding": { + "type": "string", + "description": "Number of bytes or vendor specific values when schema id is encoded in payload." + }, + "schemaLookupStrategy": { + "type": "string", + "description": "Freeform string for any naming strategy class to use. Clients should default to the vendor default if not supplied." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "key": { + "type": "string", + "enum": [ + "myKey" + ] + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "apicurio-new", + "schemaLookupStrategy": "TopicIdStrategy", + "bindingVersion": "0.3.0" + }, + { + "key": { + "$ref": "path/to/user-create.avsc#/UserCreate" + }, + "schemaIdLocation": "payload", + "schemaIdPayloadEncoding": "4", + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json": { + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/message.json", + "title": "Anypoint MQ message bindings object", + "description": "This object contains configuration for describing an Anypoint MQ message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "headers": { + "type": "object", + "properties": { + "messageId": { + "type": "string" + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { + "required": [ + "headers" + ] + } + }, + { + "properties": { + "type": { + "const": "string" + } + }, + "not": { + "required": [ + "headers" + ] + } + } + ], + "examples": [ + { + "type": "string", + "bindingVersion": "0.1.0" + }, + { + "type": "jms", + "description": "JMS stream message", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/googlepubsub/0.1.0/message.json", + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the message representation for Google Cloud Pub/Sub.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + }, + "attributes": { + "type": "object" + }, + "orderingKey": { + "type": "string" + }, + "schema": { + "type": "object", + "additionalItems": false, + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + }, + "required": [ + "name", + "type" + ] + } + }, + "examples": [ + { + "schema": { + "name": "projects/your-project-id/schemas/your-avro-schema-id", + "type": "avro" + } + }, + { + "schema": { + "name": "projects/your-project-id/schemas/your-protobuf-schema-id", + "type": "protobuf" + } + } + ] + }, + "http://asyncapi.com/definitions/3.0.0/messageTrait.json": { + "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.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" + }, + "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" + } + }, + "bindings": { + "$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": { + "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": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" + } + ] + }, + "amqp": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + } + ] + }, + "amqp1": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + } + ] + }, + "mqtt": {}, + "mqtt5": {}, + "kafka": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" + } + ] + }, + "anypointmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" + } + ] + }, + "nats": {}, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" + } + ] + }, + "solace": {}, + "googlepubsub": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json" + } + ] + } + } + }, + "http://asyncapi.com/bindings/websockets/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json", + "title": "WebSockets channel bindings object", + "description": "When using WebSockets, the channel represents the connection. Unlike other protocols that support multiple virtual channels (topics, routing keys, etc.) per connection, WebSockets doesn't support virtual channels or, put it another way, there's only one channel and its characteristics are strongly related to the protocol used for the handshake, i.e., HTTP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "POST" + ], + "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." + }, + "query": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." + }, + "headers": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "method": "POST", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/amqp/0.2.0/channel.json": { + "$id": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json", + "title": "AMQP channel bindings object", + "description": "This object contains information about the channel representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "is": { + "type": "string", + "enum": [ + "queue", + "routingKey" + ], + "description": "Defines what type of channel is it. Can be either 'queue' or 'routingKey' (default)." + }, + "exchange": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the exchange. It MUST NOT exceed 255 characters long." + }, + "type": { + "type": "string", + "enum": [ + "topic", + "direct", + "fanout", + "default", + "headers" + ], + "description": "The type of the exchange. Can be either 'topic', 'direct', 'fanout', 'default' or 'headers'." + }, + "durable": { + "type": "boolean", + "description": "Whether the exchange should survive broker restarts or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the exchange should be deleted when the last queue is unbound from it." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the exchange. Defaults to '/'." + } + }, + "description": "When is=routingKey, this object defines the exchange properties." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "maxLength": 255, + "description": "The name of the queue. It MUST NOT exceed 255 characters long." + }, + "durable": { + "type": "boolean", + "description": "Whether the queue should survive broker restarts or not." + }, + "exclusive": { + "type": "boolean", + "description": "Whether the queue should be used only by one connection or not." + }, + "autoDelete": { + "type": "boolean", + "description": "Whether the queue should be deleted when the last consumer unsubscribes." + }, + "vhost": { + "type": "string", + "default": "/", + "description": "The virtual host of the queue. Defaults to '/'." + } + }, + "description": "When is=queue, this object defines the queue properties." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "oneOf": [ + { + "properties": { + "is": { + "const": "routingKey" + } + }, + "required": [ + "exchange" + ], + "not": { + "required": [ + "queue" + ] + } + }, + { + "properties": { + "is": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "exchange" + ] + } + } + ], + "examples": [ + { + "is": "routingKey", + "exchange": { + "name": "myExchange", + "type": "topic", + "durable": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.2.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.2.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/channel.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "topic": { + "type": "string", + "description": "Kafka topic name if different from channel name." + }, + "partitions": { + "type": "integer", + "minimum": 1, + "description": "Number of partitions configured on this topic." + }, + "replicas": { + "type": "integer", + "minimum": 1, + "description": "Number of replicas configured on this topic." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "topic": "my-specific-topic", + "partitions": 20, + "replicas": 3, + "bindingVersion": "0.3.0" + } + ] + }, + "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json": { + "$id": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json", + "title": "Anypoint MQ channel bindings object", + "description": "This object contains configuration for describing an Anypoint MQ exchange, queue, or FIFO queue as an AsyncAPI channel. This objects only contains configuration that can not be provided in the AsyncAPI standard channel object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "destination": { + "type": "string", + "description": "The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. Defaults to the channel name." + }, + "destinationType": { + "type": "string", + "enum": [ + "exchange", + "queue", + "fifo-queue" + ], + "default": "queue", + "description": "The type of destination. SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) supported by this channel." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "destination": "user-signup-exchg", + "destinationType": "exchange", + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json", + "title": "IBM MQ channel bindings object", + "description": "This object contains information about the channel representation in IBM MQ. Each channel corresponds to a Queue or Topic within IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "destinationType": { + "type": "string", + "enum": [ + "topic", + "queue" + ], + "default": "topic", + "description": "Defines the type of AsyncAPI channel." + }, + "queue": { + "type": "object", + "description": "Defines the properties of a queue.", + "properties": { + "objectName": { + "type": "string", + "maxLength": 48, + "description": "Defines the name of the IBM MQ queue associated with the channel." + }, + "isPartitioned": { + "type": "boolean", + "default": false, + "description": "Defines if the queue is a cluster queue and therefore partitioned. If 'true', a binding option MAY be specified when accessing the queue. More information on binding options can be found on this page in the IBM MQ Knowledge Center." + }, + "exclusive": { + "type": "boolean", + "default": false, + "description": "Specifies if it is recommended to open the queue exclusively." + } + }, + "required": [ + "objectName" + ] + }, + "topic": { + "type": "object", + "description": "Defines the properties of a topic.", + "properties": { + "string": { + "type": "string", + "maxLength": 10240, + "description": "The value of the IBM MQ topic string to be used." + }, + "objectName": { + "type": "string", + "maxLength": 48, + "description": "The name of the IBM MQ topic object." + }, + "durablePermitted": { + "type": "boolean", + "default": true, + "description": "Defines if the subscription may be durable." + }, + "lastMsgRetained": { + "type": "boolean", + "default": false, + "description": "Defines if the last message published will be made available to new subscriptions." + } + } + }, + "maxMsgLength": { + "type": "integer", + "minimum": 0, + "maximum": 104857600, + "description": "The maximum length of the physical message (in bytes) accepted by the Topic or Queue. Messages produced that are greater in size than this value may fail to be delivered. More information on the maximum message length can be found on this [page](https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ibm.mq.ref.dev.doc/q097520_.html) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { "type": "string", - "description": "A runtime expression that specifies the location of the parameter value", - "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "const": "topic" + } + }, + "required": [ + "topic" + ], + "not": { + "required": [ + "queue" + ] + } }, - "$ref": { - "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" + { + "properties": { + "destinationType": { + "const": "queue" + } + }, + "required": [ + "queue" + ], + "not": { + "required": [ + "topic" + ] + } } - } + ], + "examples": [ + { + "destinationType": "topic", + "topic": { + "objectName": "myTopicName" + }, + "bindingVersion": "0.1.0" + }, + { + "destinationType": "queue", + "queue": { + "objectName": "myQueueName", + "exclusive": true + }, + "bindingVersion": "0.1.0" + } + ] }, - "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json", + "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json", + "title": "Cloud Pub/Sub Channel Schema", + "description": "This object contains information about the channel representation for Google Cloud Pub/Sub.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -1110,23 +2262,80 @@ } }, "properties": { - "http": {}, - "ws": {}, - "amqp": {}, - "amqp1": {}, - "mqtt": {}, - "mqtt5": {}, - "kafka": {}, - "anypointmq": {}, - "nats": {}, - "jms": {}, - "sns": {}, - "sqs": {}, - "stomp": {}, - "redis": {}, - "ibmmq": {}, - "solace": {} - } + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + }, + "labels": { + "type": "object" + }, + "messageRetentionDuration": { + "type": "string" + }, + "messageStoragePolicy": { + "type": "object", + "additionalProperties": false, + "properties": { + "allowedPersistenceRegions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "schemaSettings": { + "type": "object", + "additionalItems": false, + "properties": { + "encoding": { + "type": "string" + }, + "firstRevisionId": { + "type": "string" + }, + "lastRevisionId": { + "type": "string" + }, + "name": { + "type": "string" + } + }, + "required": [ + "encoding", + "name" + ] + }, + "topic": { + "type": "string" + } + }, + "required": [ + "schemaSettings", + "topic" + ], + "examples": [ + { + "labels": { + "label1": "value1", + "label2": "value2" + }, + "messageRetentionDuration": "86400s", + "messageStoragePolicy": { + "allowedPersistenceRegions": [ + "us-central1", + "us-east1" + ] + }, + "schemaSettings": { + "encoding": "json", + "name": "projects/your-project-id/schemas/your-schema" + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/operations.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operations.json", @@ -1205,29 +2414,228 @@ "description": { "type": "string" }, - "security": { - "type": "array", - "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/SecurityRequirement.json" - } + "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": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json" + } + ] + }, + "amqp1": {}, + "mqtt": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json" + } + ] + }, + "mqtt5": {}, + "kafka": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json" + } + ] + }, + "anypointmq": {}, + "nats": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/nats/0.1.0/operation.json" + } + ] + }, + "jms": {}, + "sns": {}, + "sqs": {}, + "stomp": {}, + "redis": {}, + "ibmmq": {}, + "solace": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/bindings/solace/0.2.0/operation.json" + }, + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/solace/0.3.0/operation.json" + } + ] + }, + "googlepubsub": {} + } + }, + "http://asyncapi.com/bindings/amqp/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json", + "title": "AMQP operation bindings object", + "description": "This object contains information about the operation representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "expiration": { + "type": "integer", + "minimum": 0, + "description": "TTL (Time-To-Live) for the message. It MUST be greater than or equal to zero." + }, + "userId": { + "type": "string", + "description": "Identifies the user who has sent the message." + }, + "cc": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The routing keys the message should be routed to at the time of publishing." + }, + "priority": { + "type": "integer", + "description": "A priority for the message." + }, + "deliveryMode": { + "type": "integer", + "enum": [ + 1, + 2 + ], + "description": "Delivery mode of the message. Its value MUST be either 1 (transient) or 2 (persistent)." + }, + "mandatory": { + "type": "boolean", + "description": "Whether the message is mandatory or not." }, - "tags": { + "bcc": { "type": "array", "items": { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + "type": "string" }, - "uniqueItems": true + "description": "Like cc but consumers will not receive this information." }, - "externalDocs": { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + "replyTo": { + "type": "string", + "description": "Name of the queue where the consumer should send the response." }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + "timestamp": { + "type": "boolean", + "description": "Whether the message should include a timestamp or not." + }, + "ack": { + "type": "boolean", + "description": "Whether the consumer should ack the message or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." } - } + }, + "examples": [ + { + "expiration": 100000, + "userId": "guest", + "cc": [ + "user.logs" + ], + "priority": 10, + "deliveryMode": 2, + "mandatory": false, + "bcc": [ + "external.audit" + ], + "replyTo": "user.signedup", + "timestamp": true, + "ack": false, + "bindingVersion": "0.2.0" + } + ] }, - "http://asyncapi.com/definitions/3.0.0/operationTrait.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json", + "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json", + "title": "MQTT operation bindings object", + "description": "This object contains information about the operation representation in MQTT.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -1236,34 +2644,126 @@ } }, "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" + "qos": { + "type": "integer", + "description": "Defines the Quality of Service (QoS) levels for the message flow between client and server. Its value MUST be either 0 (At most once delivery), 1 (At least once delivery), or 2 (Exactly once delivery)." }, - "summary": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" + "retain": { + "type": "boolean", + "description": "Whether the broker should retain the message or not." }, - "description": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description" + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "qos": 2, + "retain": true, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.1.0/operation.json", + "title": "Kafka operation message bindings object", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer group." }, - "security": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" + "clientId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer inside a consumer group." }, - "tags": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/kafka/0.3.0/operation.json": { + "$id": "http://asyncapi.com/bindings/kafka/0.3.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in Kafka.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer group." }, - "externalDocs": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" + "clientId": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "Id of the consumer inside a consumer group." }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/bindings" + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." } - } + }, + "examples": [ + { + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.3.0" + } + ] }, - "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json": { - "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", + "http://asyncapi.com/bindings/nats/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/nats/0.1.0/operation.json", + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -1272,23 +2772,243 @@ } }, "properties": { - "http": {}, - "ws": {}, - "amqp": {}, - "amqp1": {}, - "mqtt": {}, - "mqtt5": {}, - "kafka": {}, - "anypointmq": {}, - "nats": {}, - "jms": {}, - "sns": {}, - "sqs": {}, - "stomp": {}, - "redis": {}, - "ibmmq": {}, - "solace": {} - } + "queue": { + "type": "string", + "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", + "maxLength": 255 + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "queue": "MyCustomQueue", + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/solace/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/solace/0.2.0/operation.json", + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "examples": [ + { + "bindingVersion": "0.2.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] + }, + "http://asyncapi.com/bindings/solace/0.3.0/operation.json": { + "$id": "http://asyncapi.com/bindings/solace/0.3.0/operation.json", + "title": "Solace operation bindings object", + "description": "This object contains information about the operation representation in Solace.", + "type": "object", + "additionalProperties": false, + "properties": { + "destinations": { + "description": "The list of Solace destinations referenced in the operation.", + "type": "array", + "items": { + "type": "object", + "properties": { + "deliveryMode": { + "type": "string", + "enum": [ + "direct", + "persistent" + ] + } + }, + "oneOf": [ + { + "properties": { + "destinationType": { + "type": "string", + "const": "queue", + "description": "If the type is queue, then the subscriber can bind to the queue. The queue subscribes to the given topicSubscriptions. If no topicSubscriptions are provied, the queue will subscribe to the topic as represented by the channel name." + }, + "queue": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the queue" + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the queue subscribes to.", + "items": { + "type": "string" + } + }, + "accessType": { + "type": "string", + "enum": [ + "exclusive", + "nonexclusive" + ] + }, + "maxTtl": { + "type": "string", + "description": "The maximum TTL to apply to messages to be spooled." + }, + "maxMsgSpoolUsage": { + "type": "string", + "description": "The maximum amount of message spool that the given queue may use" + } + } + } + } + }, + { + "properties": { + "destinationType": { + "type": "string", + "const": "topic", + "description": "If the type is topic, then the subscriber subscribes to the given topicSubscriptions. If no topicSubscriptions are provided, the client will subscribe to the topic as represented by the channel name." + }, + "topicSubscriptions": { + "type": "array", + "description": "The list of topics that the client subscribes to.", + "items": { + "type": "string" + } + } + } + } + ] + } + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + }, + "examples": [ + { + "bindingVersion": "0.3.0", + "destinations": [ + { + "destinationType": "queue", + "queue": { + "name": "sampleQueue", + "topicSubscriptions": [ + "samples/*" + ], + "accessType": "nonexclusive" + } + }, + { + "destinationType": "topic", + "topicSubscriptions": [ + "samples/*" + ] + } + ] + } + ] }, "http://asyncapi.com/definitions/3.0.0/components.json": { "$id": "http://asyncapi.com/definitions/3.0.0/components.json", @@ -1364,25 +3084,25 @@ "serverBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } }, "channelBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" } }, "operationBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" } }, "messageBindings": { "type": "object", "additionalProperties": { - "$ref": "http://asyncapi.com/definitions/3.0.0/bindingsObject.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" } } } @@ -1948,29 +3668,6 @@ "$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/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. " diff --git a/tools/bundler/package-lock.json b/tools/bundler/package-lock.json index e9a3a017..6fcc6076 100644 --- a/tools/bundler/package-lock.json +++ b/tools/bundler/package-lock.json @@ -1,159 +1,8 @@ { "name": "bundler", "version": "1.0.0", - "lockfileVersion": 2, + "lockfileVersion": 1, "requires": true, - "packages": { - "": { - "name": "bundler", - "version": "1.0.0", - "license": "Apache-2.0", - "dependencies": { - "@hyperjump/json-schema-bundle": "0.1.3" - } - }, - "node_modules/@hyperjump/json-pointer": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-0.9.1.tgz", - "integrity": "sha512-tiDl/9MOkkiUQ5t+wq4PhtPghgWmFyBwU9Q6xRkXksg2s/6GNxNPcO/MzOjJoDAeCY1XXajNUIkco7wvhNmlOA==", - "dependencies": { - "just-curry-it": "^3.2.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, - "node_modules/@hyperjump/json-schema": { - "version": "0.18.3", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-0.18.3.tgz", - "integrity": "sha512-HKrrsuJOlYdqpHEr/eRU99LCiAe8ZH4LUkQOQOMa/P8pNSgs4FQHMKy3sgkmgLSgdmQbRX2/hA+yn2Ts/gS0lA==", - "dependencies": { - "@hyperjump/json-schema-core": "^0.23.4", - "fastest-stable-stringify": "^2.0.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, - "node_modules/@hyperjump/json-schema-bundle": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-bundle/-/json-schema-bundle-0.1.3.tgz", - "integrity": "sha512-UjmmtyIgaMXRXKmkJDQhvGAQFSfaPYBRue4tk3qeISrD468vziCWI2Km0RgfeXVxgy5xgqEPyi9DLXUqD4KWDQ==", - "dependencies": { - "@hyperjump/json-schema": "^0.18.3", - "uuid": "^8.3.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, - "node_modules/@hyperjump/json-schema-core": { - "version": "0.23.4", - "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-core/-/json-schema-core-0.23.4.tgz", - "integrity": "sha512-rHORA3qPk2JKOJOgwgXzGkMnad0neoPiHK8tPrITNxCcVM+AwPkTK+ABogNhbFG4lipWVF4gB3XHJ2qxfQuSAw==", - "dependencies": { - "@hyperjump/json-pointer": "^0.9.1", - "@hyperjump/pact": "^0.2.0", - "content-type": "^1.0.4", - "node-fetch": "^2.6.5", - "pubsub-js": "^1.9.1", - "url-resolve-browser": "^1.2.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, - "node_modules/@hyperjump/pact": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-0.2.0.tgz", - "integrity": "sha512-RHt0XRFsADXbqopurGZfCUNL7mPc0695TD2HNDqs4RCK5Db/1lDU2Bhk9EsyFmCBE9N1/boyvdKWjT1UYHIebg==", - "dependencies": { - "just-curry-it": "^3.1.0" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/jdesrosiers" - } - }, - "node_modules/content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/fastest-stable-stringify": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz", - "integrity": "sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q==" - }, - "node_modules/just-curry-it": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-3.2.1.tgz", - "integrity": "sha512-Q8206k8pTY7krW32cdmPsP+DqqLgWx/hYPSj9/+7SYqSqz7UuwPbfSe07lQtvuuaVyiSJveXk0E5RydOuWwsEg==" - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } - } - }, - "node_modules/pubsub-js": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz", - "integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==" - }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/url-resolve-browser": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/url-resolve-browser/-/url-resolve-browser-1.2.0.tgz", - "integrity": "sha512-L9PBPnlKNDFzt9ElK4br8I8Tufdm1xgv1GhMeiP7ZC87x0b7mr+4vSh13kmPq5km80JKX+UD2BeEFTCrFZ6xDA==" - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" - }, - "node_modules/whatwg-url": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" - } - } - }, "dependencies": { "@hyperjump/json-pointer": { "version": "0.9.1", From ccb5fcd5b8a96d5298dbebfd8ec313dbed74208a Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Fri, 9 Dec 2022 18:53:41 +0100 Subject: [PATCH 09/13] added ajv as dependency --- package-lock.json | 50 +++++++++++ package.json | 5 +- tools/bundler/package-lock.json | 153 +++++++++++++++++++++++++++++++- 3 files changed, 205 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 7cca6536..55917487 100644 --- a/package-lock.json +++ b/package-lock.json @@ -621,6 +621,11 @@ "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", "dev": true }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==" + }, "@types/minimist": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.2.tgz", @@ -680,6 +685,18 @@ "indent-string": "^4.0.0" } }, + "ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", @@ -1388,6 +1405,12 @@ } } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, "fast-glob": { "version": "3.2.11", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", @@ -2194,6 +2217,12 @@ "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -5329,6 +5358,12 @@ "once": "^1.3.1" } }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -5535,6 +5570,12 @@ "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", @@ -8012,6 +8053,15 @@ "integrity": "sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug==", "dev": true }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "url-join": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/url-join/-/url-join-4.0.1.tgz", diff --git a/package.json b/package.json index d876372c..9403dd12 100644 --- a/package.json +++ b/package.json @@ -38,13 +38,14 @@ }, "homepage": "https://github.com/asyncapi/spec-json-schemas#readme", "devDependencies": { - "mocha": "^10.0.0", - "nyc": "^15.1.0", "@semantic-release/commit-analyzer": "^8.0.1", "@semantic-release/github": "7.2.3", "@semantic-release/npm": "^7.0.3", "@semantic-release/release-notes-generator": "^9.0.1", + "ajv": "^8.11.2", "conventional-changelog-conventionalcommits": "^4.2.3", + "mocha": "^10.0.0", + "nyc": "^15.1.0", "semantic-release": "19.0.3" }, "release": { diff --git a/tools/bundler/package-lock.json b/tools/bundler/package-lock.json index 6fcc6076..e9a3a017 100644 --- a/tools/bundler/package-lock.json +++ b/tools/bundler/package-lock.json @@ -1,8 +1,159 @@ { "name": "bundler", "version": "1.0.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "bundler", + "version": "1.0.0", + "license": "Apache-2.0", + "dependencies": { + "@hyperjump/json-schema-bundle": "0.1.3" + } + }, + "node_modules/@hyperjump/json-pointer": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/@hyperjump/json-pointer/-/json-pointer-0.9.1.tgz", + "integrity": "sha512-tiDl/9MOkkiUQ5t+wq4PhtPghgWmFyBwU9Q6xRkXksg2s/6GNxNPcO/MzOjJoDAeCY1XXajNUIkco7wvhNmlOA==", + "dependencies": { + "just-curry-it": "^3.2.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/json-schema": { + "version": "0.18.3", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema/-/json-schema-0.18.3.tgz", + "integrity": "sha512-HKrrsuJOlYdqpHEr/eRU99LCiAe8ZH4LUkQOQOMa/P8pNSgs4FQHMKy3sgkmgLSgdmQbRX2/hA+yn2Ts/gS0lA==", + "dependencies": { + "@hyperjump/json-schema-core": "^0.23.4", + "fastest-stable-stringify": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/json-schema-bundle": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-bundle/-/json-schema-bundle-0.1.3.tgz", + "integrity": "sha512-UjmmtyIgaMXRXKmkJDQhvGAQFSfaPYBRue4tk3qeISrD468vziCWI2Km0RgfeXVxgy5xgqEPyi9DLXUqD4KWDQ==", + "dependencies": { + "@hyperjump/json-schema": "^0.18.3", + "uuid": "^8.3.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/json-schema-core": { + "version": "0.23.4", + "resolved": "https://registry.npmjs.org/@hyperjump/json-schema-core/-/json-schema-core-0.23.4.tgz", + "integrity": "sha512-rHORA3qPk2JKOJOgwgXzGkMnad0neoPiHK8tPrITNxCcVM+AwPkTK+ABogNhbFG4lipWVF4gB3XHJ2qxfQuSAw==", + "dependencies": { + "@hyperjump/json-pointer": "^0.9.1", + "@hyperjump/pact": "^0.2.0", + "content-type": "^1.0.4", + "node-fetch": "^2.6.5", + "pubsub-js": "^1.9.1", + "url-resolve-browser": "^1.2.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/@hyperjump/pact": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@hyperjump/pact/-/pact-0.2.0.tgz", + "integrity": "sha512-RHt0XRFsADXbqopurGZfCUNL7mPc0695TD2HNDqs4RCK5Db/1lDU2Bhk9EsyFmCBE9N1/boyvdKWjT1UYHIebg==", + "dependencies": { + "just-curry-it": "^3.1.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/jdesrosiers" + } + }, + "node_modules/content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fastest-stable-stringify": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fastest-stable-stringify/-/fastest-stable-stringify-2.0.2.tgz", + "integrity": "sha512-bijHueCGd0LqqNK9b5oCMHc0MluJAx0cwqASgbWMvkO01lCYgIhacVRLcaDz3QnyYIRNJRDwMb41VuT6pHJ91Q==" + }, + "node_modules/just-curry-it": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/just-curry-it/-/just-curry-it-3.2.1.tgz", + "integrity": "sha512-Q8206k8pTY7krW32cdmPsP+DqqLgWx/hYPSj9/+7SYqSqz7UuwPbfSe07lQtvuuaVyiSJveXk0E5RydOuWwsEg==" + }, + "node_modules/node-fetch": { + "version": "2.6.7", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", + "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/pubsub-js": { + "version": "1.9.4", + "resolved": "https://registry.npmjs.org/pubsub-js/-/pubsub-js-1.9.4.tgz", + "integrity": "sha512-hJYpaDvPH4w8ZX/0Fdf9ma1AwRgU353GfbaVfPjfJQf1KxZ2iHaHl3fAUw1qlJIR5dr4F3RzjGaWohYUEyoh7A==" + }, + "node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" + }, + "node_modules/url-resolve-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/url-resolve-browser/-/url-resolve-browser-1.2.0.tgz", + "integrity": "sha512-L9PBPnlKNDFzt9ElK4br8I8Tufdm1xgv1GhMeiP7ZC87x0b7mr+4vSh13kmPq5km80JKX+UD2BeEFTCrFZ6xDA==" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + }, + "node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } + }, "dependencies": { "@hyperjump/json-pointer": { "version": "0.9.1", From aba9e3cbb40842bf95cd1ed2fcace80dcf484161 Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Fri, 9 Dec 2022 19:21:02 +0100 Subject: [PATCH 10/13] fixed tests --- test/docs/3.0.0/streetlights-all.json | 328 +++----------------------- 1 file changed, 35 insertions(+), 293 deletions(-) diff --git a/test/docs/3.0.0/streetlights-all.json b/test/docs/3.0.0/streetlights-all.json index 59c27bdf..d0b16f55 100644 --- a/test/docs/3.0.0/streetlights-all.json +++ b/test/docs/3.0.0/streetlights-all.json @@ -1,315 +1,57 @@ { "asyncapi": "3.0.0", "info": { - "title": "Streetlights All protocol API", + "title": "Account Service", "version": "1.0.0", - "description": "The Smartylighting Streetlights API allows you to remotely manage the city lights.\n\n### Check out its awesome features:\n\n* Turn a specific streetlight on/off 🌃\n* Dim a specific streetlight 😎\n* Receive real-time information about environmental lighting conditions 📈\n", - "license": { - "name": "Apache 2.0", - "url": "https://www.apache.org/licenses/LICENSE-2.0" - } - }, - "servers": { - "scram-kafka": { - "url": "test.mykafkacluster.org:18092", - "protocol": "kafka-secure", - "description": "Test broker secured with scramSha256", - "security": [ - { - "saslScram": [] - } - ] - }, - "mqtt": { - "url": "test.mosquitto.org:{port}", - "protocol": "mqtt", - "description": "Test broker", - "variables": { - "port": { - "description": "Secure connection (TLS) is available through port 8883.", - "default": "1883", - "enum": [ - "1883", - "8883" - ] - } - }, - "security": [ - { - "apiKey": [] - }, - { - "supportedOauthFlows": [ - "streetlights:on", - "streetlights:off", - "streetlights:dim" - ] - }, - { - "openIdConnectWellKnown": [] - } - ] - } + "description": "This service is in charge of processing user signups" }, - "defaultContentType": "application/json", "channels": { - "smartylighting/streetlights/1/0/event/{streetlightId}/lighting/measured": { - "description": "The topic on which measured values may be produced and consumed.", - "parameters": { - "streetlightId": { - "$ref": "#/components/parameters/streetlightId" - } - }, - "publish": { - "summary": "Inform about environmental lighting conditions of a particular streetlight.", - "operationId": "receiveLightMeasurement", - "traits": [ - { - "$ref": "#/components/operationTraits/all-protocols" - } - ], - "message": { - "$ref": "#/components/messages/lightMeasured" + "UserSignedUpChannel": { + "address": "user/signedup", + "messages": { + "UserSignedUp": { + "$ref": "#/components/messages/UserSignedUp" } } - }, - "smartylighting/streetlights/1/0/action/{streetlightId}/turn/on": { - "parameters": { - "streetlightId": { - "$ref": "#/components/parameters/streetlightId" - } - }, - "subscribe": { - "operationId": "turnOn", - "traits": [ - { - "$ref": "#/components/operationTraits/all-protocols" - } - ], - "message": { - "$ref": "#/components/messages/turnOnOff" - } - } - }, - "smartylighting/streetlights/1/0/action/{streetlightId}/turn/off": { - "parameters": { - "streetlightId": { - "$ref": "#/components/parameters/streetlightId" - } - }, - "subscribe": { - "operationId": "turnOff", - "traits": [ - { - "$ref": "#/components/operationTraits/all-protocols" - } - ], - "message": { - "$ref": "#/components/messages/turnOnOff" - } - } - }, - "smartylighting/streetlights/1/0/action/{streetlightId}/dim": { - "parameters": { - "streetlightId": { - "$ref": "#/components/parameters/streetlightId" - } - }, - "subscribe": { - "operationId": "dimLight", - "traits": [ - { - "$ref": "#/components/operationTraits/all-protocols" + } + }, + "operations": { + "PublishUserSignedUp": { + "action": "send", + "channel": { + "$ref": "#/channels/UserSignedUpChannel" + }, + "bindings": { + "mqtt": { + "bindingVersion": "0.1.0", + "qos": 1 + }, + "kafka": { + "bindingVersion": "0.3.0", + "clientId": { + "type": "string", + "enum": [ + "my-app-id" + ] } - ], - "message": { - "$ref": "#/components/messages/dimLight" } } } }, "components": { "messages": { - "lightMeasured": { - "name": "lightMeasured", - "title": "Light measured", - "summary": "Inform about environmental lighting conditions of a particular streetlight.", - "contentType": "application/json", - "traits": [ - { - "$ref": "#/components/messageTraits/commonHeaders" - } - ], - "payload": { - "$ref": "#/components/schemas/lightMeasuredPayload" - } - }, - "turnOnOff": { - "name": "turnOnOff", - "title": "Turn on/off", - "summary": "Command a particular streetlight to turn the lights on or off.", - "traits": [ - { - "$ref": "#/components/messageTraits/commonHeaders" - } - ], + "UserSignedUp": { "payload": { - "$ref": "#/components/schemas/turnOnOffPayload" - } - }, - "dimLight": { - "name": "dimLight", - "title": "Dim light", - "summary": "Command a particular streetlight to dim the lights.", - "traits": [ - { - "$ref": "#/components/messageTraits/commonHeaders" - } - ], - "payload": { - "$ref": "#/components/schemas/dimLightPayload" - } - } - }, - "schemas": { - "lightMeasuredPayload": { - "type": "object", - "properties": { - "lumens": { - "type": "integer", - "minimum": 0, - "description": "Light intensity measured in lumens." - }, - "sentAt": { - "$ref": "#/components/schemas/sentAt" - } - } - }, - "turnOnOffPayload": { - "type": "object", - "properties": { - "command": { - "type": "string", - "enum": [ - "on", - "off" - ], - "description": "Whether to turn on or off the light." - }, - "sentAt": { - "$ref": "#/components/schemas/sentAt" - } - } - }, - "dimLightPayload": { - "type": "object", - "properties": { - "percentage": { - "type": "integer", - "description": "Percentage to which the light should be dimmed to.", - "minimum": 0, - "maximum": 100 - }, - "sentAt": { - "$ref": "#/components/schemas/sentAt" - } - } - }, - "sentAt": { - "type": "string", - "format": "date-time", - "description": "Date and time when the message was sent." - } - }, - "securitySchemes": { - "saslScram": { - "type": "scramSha256", - "description": "Provide your username and password for SASL/SCRAM authentication" - }, - "apiKey": { - "type": "apiKey", - "in": "user", - "description": "Provide your API key as the user and leave the password empty." - }, - "supportedOauthFlows": { - "type": "oauth2", - "description": "Flows to support OAuth 2.0", - "flows": { - "implicit": { - "authorizationUrl": "https://authserver.example/auth", - "scopes": { - "streetlights:on": "Ability to switch lights on", - "streetlights:off": "Ability to switch lights off", - "streetlights:dim": "Ability to dim the lights" - } - }, - "password": { - "tokenUrl": "https://authserver.example/token", - "scopes": { - "streetlights:on": "Ability to switch lights on", - "streetlights:off": "Ability to switch lights off", - "streetlights:dim": "Ability to dim the lights" - } - }, - "clientCredentials": { - "tokenUrl": "https://authserver.example/token", - "scopes": { - "streetlights:on": "Ability to switch lights on", - "streetlights:off": "Ability to switch lights off", - "streetlights:dim": "Ability to dim the lights" - } - }, - "authorizationCode": { - "authorizationUrl": "https://authserver.example/auth", - "tokenUrl": "https://authserver.example/token", - "refreshUrl": "https://authserver.example/refresh", - "scopes": { - "streetlights:on": "Ability to switch lights on", - "streetlights:off": "Ability to switch lights off", - "streetlights:dim": "Ability to dim the lights" - } - } - } - }, - "openIdConnectWellKnown": { - "type": "openIdConnect", - "openIdConnectUrl": "https://authserver.example/.well-known" - } - }, - "parameters": { - "streetlightId": { - "description": "The ID of the streetlight.", - "schema": { - "type": "string" - } - } - }, - "messageTraits": { - "commonHeaders": { - "headers": { "type": "object", "properties": { - "my-app-header": { - "type": "integer", - "minimum": 0, - "maximum": 100 - } - } - } - } - }, - "operationTraits": { - "all-protocols": { - "bindings": { - "mqtt": { - "qos": 1 - }, - "kafka": { - "clientId": { + "displayName": { + "type": "string", + "description": "Name of the user" + }, + "email": { "type": "string", - "enum": [ - "my-app-id" - ] + "format": "email", + "description": "Email of the user" } } } From fb960eea98d9235565a2fea08d8ca8dbcf4612ba Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Wed, 11 Jan 2023 11:24:14 +0100 Subject: [PATCH 11/13] add pulsar binding --- CODEOWNERS | 3 +- bindings/mqtt/0.1.0/server.json | 1 - bindings/pulsar/0.1.0/channel.json | 92 ++++++++++++++++++++ bindings/pulsar/0.1.0/server.json | 32 +++++++ definitions/3.0.0/channelBindingsObject.json | 8 ++ definitions/3.0.0/serverBindingsObject.json | 10 ++- 6 files changed, 143 insertions(+), 3 deletions(-) create mode 100644 bindings/pulsar/0.1.0/channel.json create mode 100644 bindings/pulsar/0.1.0/server.json diff --git a/CODEOWNERS b/CODEOWNERS index 91d5e9f7..5fc5affa 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -14,4 +14,5 @@ /bindings/kafka/ @lbroudoux @dalelane /bindings/googlepubsub/ @whitlockjc /bindings/solace/ @damaru-inc @CameronRushton -/bindings/*.json @KhudaDad414 \ No newline at end of file +/bindings/*.json @KhudaDad414 +/bindings/pulsar/ @VisualBean \ No newline at end of file diff --git a/bindings/mqtt/0.1.0/server.json b/bindings/mqtt/0.1.0/server.json index 3f98e13e..5190fed0 100644 --- a/bindings/mqtt/0.1.0/server.json +++ b/bindings/mqtt/0.1.0/server.json @@ -11,7 +11,6 @@ } }, "properties": { - "clientId": { "type": "string", "description": "The client identifier." diff --git a/bindings/pulsar/0.1.0/channel.json b/bindings/pulsar/0.1.0/channel.json new file mode 100644 index 00000000..cbd42bf0 --- /dev/null +++ b/bindings/pulsar/0.1.0/channel.json @@ -0,0 +1,92 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "namespace", + "persistence" + ], + "properties": { + "namespace": { + "type": "string", + "description": "The namespace, the channel is associated with." + }, + "persistence": { + "type": "string", + "enum": [ + "persistent", + "non-persistent" + ], + "description": "persistence of the topic in Pulsar." + }, + "compaction": { + "type": "integer", + "minimum": 0, + "description": "Topic compaction threshold given in MB" + }, + "geo-replication": { + "type": "array", + "description": "A list of clusters the topic is replicated to.", + "items": { + "type": "string" + } + }, + "retention": { + "type": "object", + "additionalProperties": false, + "properties": { + "time": { + "type": "integer", + "minimum": 0, + "description": "Time given in Minutes. `0` = Disable message retention." + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + "ttl": { + "type": "integer", + "description": "TTL in seconds for the specified topic" + }, + "deduplication": { + "type": "boolean", + "description": "Whether deduplication of events is enabled or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "namespace": "ns1", + "persistence": "persistent", + "compaction": 1000, + "retention": { + "time": 15, + "size": 1000 + }, + "ttl": 360, + "geo-replication": [ + "us-west", + "us-east" + ], + "deduplication": true, + "bindingVersion": "0.1.0" + } + ] +} \ No newline at end of file diff --git a/bindings/pulsar/0.1.0/server.json b/bindings/pulsar/0.1.0/server.json new file mode 100644 index 00000000..33d05e33 --- /dev/null +++ b/bindings/pulsar/0.1.0/server.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json", + "title": "Server Schema", + "description": "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\-\\_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "tenant": { + "type": "string", + "description": "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "tenant": "contoso", + "bindingVersion": "0.1.0" + } + ] +} \ No newline at end of file diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index b5ddd0a2..10590f36 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -72,6 +72,14 @@ "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json" } ] + }, + "pulsar": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + ] } }, "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 6389a768..cac1a597 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -54,7 +54,15 @@ } ] }, - "googlepubsub": {} + "googlepubsub": {}, + "pulsar": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + ] + } }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" From e9bfe13edeaedc3f67b54b98319a354137bb890e Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Wed, 11 Jan 2023 11:26:38 +0100 Subject: [PATCH 12/13] fixed pattern property for pulsar --- bindings/pulsar/0.1.0/channel.json | 2 +- bindings/pulsar/0.1.0/server.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bindings/pulsar/0.1.0/channel.json b/bindings/pulsar/0.1.0/channel.json index cbd42bf0..187194f2 100644 --- a/bindings/pulsar/0.1.0/channel.json +++ b/bindings/pulsar/0.1.0/channel.json @@ -6,7 +6,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/bindings/pulsar/0.1.0/server.json b/bindings/pulsar/0.1.0/server.json index 33d05e33..f894fac1 100644 --- a/bindings/pulsar/0.1.0/server.json +++ b/bindings/pulsar/0.1.0/server.json @@ -6,7 +6,7 @@ "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\-\\_]+$": { + "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, From da2dc5eedf9fd20911c1f9196b13f89506f13e9c Mon Sep 17 00:00:00 2001 From: jonaslagoni Date: Wed, 11 Jan 2023 11:27:47 +0100 Subject: [PATCH 13/13] update spec generation --- schemas/3.0.0.json | 140 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 139 insertions(+), 1 deletion(-) diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index b85530e6..4972587b 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -334,7 +334,15 @@ } ] }, - "googlepubsub": {} + "googlepubsub": {}, + "pulsar": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json" + } + ] + } } }, "http://asyncapi.com/bindings/mqtt/0.1.0/server.json": { @@ -566,6 +574,37 @@ } ] }, + "http://asyncapi.com/bindings/pulsar/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/pulsar/0.1.0/server.json", + "title": "Server Schema", + "description": "This object contains server information of Pulsar broker, which covers cluster and tenant admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "tenant": { + "type": "string", + "description": "The pulsar tenant. If omitted, 'public' MUST be assumed." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "tenant": "contoso", + "bindingVersion": "0.1.0" + } + ] + }, "http://asyncapi.com/definitions/3.0.0/channels.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channels.json", "type": "object", @@ -1836,6 +1875,14 @@ "$ref": "http://asyncapi.com/bindings/googlepubsub/0.1.0/channel.json" } ] + }, + "pulsar": { + "oneOf": [ + { + "description": "Latest binding", + "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" + } + ] } } }, @@ -2337,6 +2384,97 @@ } ] }, + "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in Pulsar, which covers namespace and topic level admin configuration. This object contains additional information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": [ + "namespace", + "persistence" + ], + "properties": { + "namespace": { + "type": "string", + "description": "The namespace, the channel is associated with." + }, + "persistence": { + "type": "string", + "enum": [ + "persistent", + "non-persistent" + ], + "description": "persistence of the topic in Pulsar." + }, + "compaction": { + "type": "integer", + "minimum": 0, + "description": "Topic compaction threshold given in MB" + }, + "geo-replication": { + "type": "array", + "description": "A list of clusters the topic is replicated to.", + "items": { + "type": "string" + } + }, + "retention": { + "type": "object", + "additionalProperties": false, + "properties": { + "time": { + "type": "integer", + "minimum": 0, + "description": "Time given in Minutes. `0` = Disable message retention." + }, + "size": { + "type": "integer", + "minimum": 0, + "description": "Size given in MegaBytes. `0` = Disable message retention." + } + } + }, + "ttl": { + "type": "integer", + "description": "TTL in seconds for the specified topic" + }, + "deduplication": { + "type": "boolean", + "description": "Whether deduplication of events is enabled or not." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "namespace": "ns1", + "persistence": "persistent", + "compaction": 1000, + "retention": { + "time": 15, + "size": 1000 + }, + "ttl": 360, + "geo-replication": [ + "us-west", + "us-east" + ], + "deduplication": true, + "bindingVersion": "0.1.0" + } + ] + }, "http://asyncapi.com/definitions/3.0.0/operations.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operations.json", "type": "object",