From 6fe093f16e12034735915fa0bf0a8649ffa167ce Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Tue, 25 Jul 2023 15:23:07 +0200 Subject: [PATCH 1/6] update bindings --- bindings/amqp/0.3.0/channel.json | 136 ++++++++++++++++++ bindings/amqp/0.3.0/message.json | 37 +++++ bindings/amqp/0.3.0/operation.json | 84 +++++++++++ bindings/http/0.2.0/message.json | 42 ++++++ bindings/http/0.2.0/operation.json | 82 +++++++++++ bindings/mqtt/0.2.0/message.json | 27 ++++ bindings/mqtt/0.2.0/operation.json | 37 +++++ bindings/mqtt/0.2.0/server.json | 71 +++++++++ definitions/3.0.0/channelBindingsObject.json | 8 +- definitions/3.0.0/messageBindingsObject.json | 24 ++-- .../3.0.0/operationBindingsObject.json | 24 ++-- definitions/3.0.0/serverBindingsObject.json | 8 +- 12 files changed, 548 insertions(+), 32 deletions(-) create mode 100644 bindings/amqp/0.3.0/channel.json create mode 100644 bindings/amqp/0.3.0/message.json create mode 100644 bindings/amqp/0.3.0/operation.json create mode 100644 bindings/http/0.2.0/message.json create mode 100644 bindings/http/0.2.0/operation.json create mode 100644 bindings/mqtt/0.2.0/message.json create mode 100644 bindings/mqtt/0.2.0/operation.json create mode 100644 bindings/mqtt/0.2.0/server.json diff --git a/bindings/amqp/0.3.0/channel.json b/bindings/amqp/0.3.0/channel.json new file mode 100644 index 00000000..383cd691 --- /dev/null +++ b/bindings/amqp/0.3.0/channel.json @@ -0,0 +1,136 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/amqp/0.3.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.3.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.3.0" + }, + { + "is": "queue", + "queue": { + "name": "my-queue-name", + "durable": true, + "exclusive": true, + "autoDelete": false, + "vhost": "/" + }, + "bindingVersion": "0.3.0" + } + ] +} diff --git a/bindings/amqp/0.3.0/message.json b/bindings/amqp/0.3.0/message.json new file mode 100644 index 00000000..ba1c7352 --- /dev/null +++ b/bindings/amqp/0.3.0/message.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/amqp/0.3.0/message.json", + "title": "AMQP message bindings object", + "description": "This object contains information about the message representation in AMQP.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "contentEncoding": { + "type": "string", + "description": "A MIME encoding for the message content." + }, + "messageType": { + "type": "string", + "description": "Application-specific message type." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.3.0" + ], + "description": "The version of this binding. If omitted, \"latest\" MUST be assumed." + } + }, + "examples": [ + { + "contentEncoding": "gzip", + "messageType": "user.signup", + "bindingVersion": "0.3.0" + } + ] +} diff --git a/bindings/amqp/0.3.0/operation.json b/bindings/amqp/0.3.0/operation.json new file mode 100644 index 00000000..1c359113 --- /dev/null +++ b/bindings/amqp/0.3.0/operation.json @@ -0,0 +1,84 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/amqp/0.3.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." + }, + "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.3.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" + ], + "timestamp": true, + "ack": false, + "bindingVersion": "0.3.0" + } + ] +} diff --git a/bindings/http/0.2.0/message.json b/bindings/http/0.2.0/message.json new file mode 100644 index 00000000..722a47db --- /dev/null +++ b/bindings/http/0.2.0/message.json @@ -0,0 +1,42 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/http/0.2.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.2.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.2.0" + } + ] +} diff --git a/bindings/http/0.2.0/operation.json b/bindings/http/0.2.0/operation.json new file mode 100644 index 00000000..dae731f2 --- /dev/null +++ b/bindings/http/0.2.0/operation.json @@ -0,0 +1,82 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/http/0.2.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\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "method": { + "type": "string", + "enum": [ + "GET", + "PUT", + "POST", + "PATCH", + "DELETE", + "HEAD", + "OPTIONS", + "CONNECT", + "TRACE" + ], + "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": "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": { + "type": "string", + "enum": [ + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + }, + { + "method": "GET", + "query": { + "type": "object", + "required": [ + "companyId" + ], + "properties": { + "companyId": { + "type": "number", + "minimum": 1, + "description": "The Id of the company." + } + }, + "additionalProperties": false + }, + "bindingVersion": "0.2.0" + } + ] +} + + + + diff --git a/bindings/mqtt/0.2.0/message.json b/bindings/mqtt/0.2.0/message.json new file mode 100644 index 00000000..e2d8f798 --- /dev/null +++ b/bindings/mqtt/0.2.0/message.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/mqtt/0.2.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.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "bindingVersion": "0.2.0" + } + ] +} diff --git a/bindings/mqtt/0.2.0/operation.json b/bindings/mqtt/0.2.0/operation.json new file mode 100644 index 00000000..ec042529 --- /dev/null +++ b/bindings/mqtt/0.2.0/operation.json @@ -0,0 +1,37 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/mqtt/0.2.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.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "examples": [ + { + "qos": 2, + "retain": true, + "bindingVersion": "0.2.0" + } + ] +} diff --git a/bindings/mqtt/0.2.0/server.json b/bindings/mqtt/0.2.0/server.json new file mode 100644 index 00000000..d45fdb8e --- /dev/null +++ b/bindings/mqtt/0.2.0/server.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/mqtt/0.2.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.2.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.2.0" + } + ] +} diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index c5941fe5..050f46eb 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -46,7 +46,7 @@ "amqp": { "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": ["0.3.0"] } }, "allOf": [ @@ -60,7 +60,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" } }, { @@ -68,12 +68,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.2.0" + "const": "0.3.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/channel.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" } } ] diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index e8813db6..128ddb47 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -10,7 +10,7 @@ "http": { "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": ["0.2.0"] } }, "allOf": [ @@ -24,7 +24,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/http/0.2.0/message.json" } }, { @@ -32,12 +32,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/http/0.2.0/message.json" } } ] @@ -46,7 +46,7 @@ "amqp": { "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": ["0.3.0"] } }, "allOf": [ @@ -60,7 +60,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/message.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" } }, { @@ -68,12 +68,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.2.0" + "const": "0.3.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/message.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/message.json" } } ] @@ -82,7 +82,7 @@ "mqtt": { "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": ["0.2.0"] } }, "allOf": [ @@ -96,7 +96,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" } }, { @@ -104,12 +104,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/message.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json" } } ] diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index 19157d0d..8f629437 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -10,7 +10,7 @@ "http": { "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": ["0.2.0"] } }, "allOf": [ @@ -24,7 +24,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/http/0.2.0/operation.json" } }, { @@ -32,12 +32,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/http/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/http/0.2.0/operation.json" } } ] @@ -46,7 +46,7 @@ "amqp": { "properties": { "bindingVersion": { - "enum": ["0.2.0"] + "enum": ["0.3.0"] } }, "allOf": [ @@ -60,7 +60,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" } }, { @@ -68,12 +68,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.2.0" + "const": "0.3.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/amqp/0.2.0/operation.json" + "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/operation.json" } } ] @@ -82,7 +82,7 @@ "mqtt": { "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": ["0.2.0"] } }, "allOf": [ @@ -96,7 +96,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" } }, { @@ -104,12 +104,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/operation.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json" } } ] diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index c92b9329..5782a1c5 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -14,7 +14,7 @@ "mqtt": { "properties": { "bindingVersion": { - "enum": ["0.1.0"] + "enum": ["0.2.0"] } }, "allOf": [ @@ -28,7 +28,7 @@ } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" } }, { @@ -36,12 +36,12 @@ "required": [ "bindingVersion" ], "properties": { "bindingVersion": { - "const": "0.1.0" + "const": "0.2.0" } } }, "then": { - "$ref": "http://asyncapi.com/bindings/mqtt/0.1.0/server.json" + "$ref": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json" } } ] From 6bbc56e90a56015f67f9bb76c04411e7bac17e2a Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Tue, 1 Aug 2023 17:28:21 +0200 Subject: [PATCH 2/6] update docs for testing --- test/docs/3.0.0/streetlights-all.json | 2 +- test/docs/3.0.0/streetlights-avro.json | 2 +- test/docs/3.0.0/streetlights-openapi.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/docs/3.0.0/streetlights-all.json b/test/docs/3.0.0/streetlights-all.json index c3a24f83..15b7cdc6 100644 --- a/test/docs/3.0.0/streetlights-all.json +++ b/test/docs/3.0.0/streetlights-all.json @@ -37,7 +37,7 @@ }, "bindings": { "mqtt": { - "bindingVersion": "0.1.0", + "bindingVersion": "0.2.0", "qos": 1 }, "kafka": { diff --git a/test/docs/3.0.0/streetlights-avro.json b/test/docs/3.0.0/streetlights-avro.json index acbeea2c..34eed135 100644 --- a/test/docs/3.0.0/streetlights-avro.json +++ b/test/docs/3.0.0/streetlights-avro.json @@ -23,7 +23,7 @@ }, "bindings": { "mqtt": { - "bindingVersion": "0.1.0", + "bindingVersion": "0.2.0", "qos": 1 }, "kafka": { diff --git a/test/docs/3.0.0/streetlights-openapi.json b/test/docs/3.0.0/streetlights-openapi.json index 84d64449..08f25ae4 100644 --- a/test/docs/3.0.0/streetlights-openapi.json +++ b/test/docs/3.0.0/streetlights-openapi.json @@ -23,7 +23,7 @@ }, "bindings": { "mqtt": { - "bindingVersion": "0.1.0", + "bindingVersion": "0.2.0", "qos": 1 }, "kafka": { From 788d9e02d112efe5796c7c8c66afabf747079865 Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Mon, 7 Aug 2023 12:10:55 +0200 Subject: [PATCH 3/6] add info --- README.md | 4 +++- migrations/migrate-to-version-5.md | 28 ++++++++++++++++++++++++++++ migrations/migrate-to-version-6.md | 21 +++++++++++++++++++++ schemas/all.schema-store.json | 14 ++++++++++++++ 4 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 migrations/migrate-to-version-5.md create mode 100644 migrations/migrate-to-version-6.md diff --git a/README.md b/README.md index 97315fb2..9fe26680 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,8 @@ func Do() { If you are currently using version 2, check out [migration guideline to version 3](./migrations/migrate-to-version-3.md). If you are currently using version 3, check out [migration guideline to version 4](./migrations/migrate-to-version-4.md). +If you are currently using version 4, check out [migration guideline to version 5](./migrations/migrate-to-version-5.md). +If you are currently using version 5, check out [migration guideline to version 6](./migrations/migrate-to-version-6.md). ## Repository structure @@ -183,7 +185,7 @@ Whenever a Breaking Change is introduced, the following steps should be taken in ## SchemaStore compatibility testing -AsyncAPI JSON Schema is referenced in [SchemaStore](https://www.schemastore.org/json/). In many IDEs, like VSCode, some extensions integrate with SchemaStore, like [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). This way we enable autocompletion, validation and tooltips that helps writing AsyncAPI documents. +AsyncAPI JSON Schema is referenced in [SchemaStore](https://www.schemastore.org/json/). In many IDEs, like VSCode, some extensions integrate with SchemaStore, like [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml). This way we enable autocompletion, validation and tooltips that help write AsyncAPI documents. Whenever you make changes in AsyncAPI JSON Schema, you should always manually verify that the schema is still supported by [YAML](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml) and that it will be able to fetch and dereference it. diff --git a/migrations/migrate-to-version-5.md b/migrations/migrate-to-version-5.md new file mode 100644 index 00000000..3ea00da2 --- /dev/null +++ b/migrations/migrate-to-version-5.md @@ -0,0 +1,28 @@ +# Migrating to version 5 + +In version 5, we now export two different types of schemas, one using `$id` feature in JSON Schema, and one without. + +In v4, the library would export the schemas as: +```js +module.exports = { + '2.0.0': require('./schemas/2.0.0.json'), + ... +}; +``` + +In v5, you need to access the schemas through `.schemas` instead. + +```js +module.exports = { + 'schemas': { + '2.0.0': require('./schemas/2.0.0.json'), + ... + }, + 'schemasWithoutId': { + '2.0.0': require('./schemas/2.0.0-without-$id.json'), + ... + } +}; +``` + +And if you want the schemas without `$id`, use `schemasWithoutId`. \ No newline at end of file diff --git a/migrations/migrate-to-version-6.md b/migrations/migrate-to-version-6.md new file mode 100644 index 00000000..b7b381bf --- /dev/null +++ b/migrations/migrate-to-version-6.md @@ -0,0 +1,21 @@ +# Migrating to version 6 + +In version 6 and onwards, all pre-release spec versions will be released as a regular feature request, before the spec itself is released. + +The pre-release version will be released as if it was not a pre-release, for example for AsyncAPI 3.0, it will be released as normal: +```js +module.exports = { + 'schemas': { + ... + '3.0.0': require('./schemas/3.0.0.json'), + }, + 'schemasWithoutId': { + ... + '3.0.0': require('./schemas/3.0.0-without-$id.json'), + } +}; +``` + +However, while the it's still a pre-release, the underlying schemas CAN contain breaking changes from version to version, up until the spec is released. This means that one AsyncAPI document using v3 in the pre-release stage might be valid in `6.0.0`, but invalid in the `6.1.0`. This ONLY applies to pre-release schemas, and NOT regular ones that is set in stone. + +If you want to make sure you don't use a schema not released yet, you have to whitelist which versions you allow in your tool. \ No newline at end of file diff --git a/schemas/all.schema-store.json b/schemas/all.schema-store.json index e774f6fd..c8241a9e 100644 --- a/schemas/all.schema-store.json +++ b/schemas/all.schema-store.json @@ -172,6 +172,20 @@ "$ref": "http://asyncapi.com/schema-store/2.6.0-without-$id.json" } ] + }, + { + "allOf": [ + { + "properties": { + "asyncapi": { + "const": "3.0.0" + } + } + }, + { + "$ref": "http://asyncapi.com/schema-store/3.0.0-without-$id.json" + } + ] } ] } From 340e842a3a27498361022e743b4239fbb77d593e Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Mon, 9 Oct 2023 10:16:34 +0200 Subject: [PATCH 4/6] add v6 migration guide --- migrations/migrate-to-version-6.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/migrations/migrate-to-version-6.md b/migrations/migrate-to-version-6.md index b7b381bf..438a01f2 100644 --- a/migrations/migrate-to-version-6.md +++ b/migrations/migrate-to-version-6.md @@ -1,21 +1,3 @@ # Migrating to version 6 -In version 6 and onwards, all pre-release spec versions will be released as a regular feature request, before the spec itself is released. - -The pre-release version will be released as if it was not a pre-release, for example for AsyncAPI 3.0, it will be released as normal: -```js -module.exports = { - 'schemas': { - ... - '3.0.0': require('./schemas/3.0.0.json'), - }, - 'schemasWithoutId': { - ... - '3.0.0': require('./schemas/3.0.0-without-$id.json'), - } -}; -``` - -However, while the it's still a pre-release, the underlying schemas CAN contain breaking changes from version to version, up until the spec is released. This means that one AsyncAPI document using v3 in the pre-release stage might be valid in `6.0.0`, but invalid in the `6.1.0`. This ONLY applies to pre-release schemas, and NOT regular ones that is set in stone. - -If you want to make sure you don't use a schema not released yet, you have to whitelist which versions you allow in your tool. \ No newline at end of file +In version 6 and onwards, all bindings will now be validated along side the specification. This means that documents that was valid before might not be valid anymore if the bindings in their document is incorrect. \ No newline at end of file From 2fd759a40a34a80f9667b81abec3aadd47c94b39 Mon Sep 17 00:00:00 2001 From: "jonas-lt@live.dk" Date: Mon, 9 Oct 2023 17:25:14 +0200 Subject: [PATCH 5/6] add migration guide --- migrations/migrate-to-version-6.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/migrations/migrate-to-version-6.md b/migrations/migrate-to-version-6.md index 438a01f2..8b40e815 100644 --- a/migrations/migrate-to-version-6.md +++ b/migrations/migrate-to-version-6.md @@ -1,3 +1,21 @@ # Migrating to version 6 -In version 6 and onwards, all bindings will now be validated along side the specification. This means that documents that was valid before might not be valid anymore if the bindings in their document is incorrect. \ No newline at end of file +In version 6 and onwards, all pre-release AsyncAPI specification versions will be released as a regular feature request, before the AsyncAPI specification itself is released. + +The pre-release version will be released as if it was not a pre-release, for example for AsyncAPI 3.0, it will be released as normal: +```js +module.exports = { + 'schemas': { + ... + '3.0.0': require('./schemas/3.0.0.json'), + }, + 'schemasWithoutId': { + ... + '3.0.0': require('./schemas/3.0.0-without-$id.json'), + } +}; +``` + +However, while the it's still a pre-release, the underlying schemas CAN contain breaking changes from version to version, up until the AsyncAPI specification is released. This means that one AsyncAPI document using v3 in the pre-release stage might be valid in `6.0.0`, but invalid in the `6.1.0`. This ONLY applies to pre-release schemas, and NOT regular ones that is set in stone. + +If you want to make sure you don't use a schema not released yet, you have to whitelist which versions you allow in your tool. \ No newline at end of file From f1ea2b21567e49fb2bc3690bf542d09340df457b Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Mon, 20 Nov 2023 11:48:19 -1000 Subject: [PATCH 6/6] Update migrations/migrate-to-version-6.md Co-authored-by: Dale Lane --- migrations/migrate-to-version-6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/migrate-to-version-6.md b/migrations/migrate-to-version-6.md index 8b40e815..c246cbdd 100644 --- a/migrations/migrate-to-version-6.md +++ b/migrations/migrate-to-version-6.md @@ -16,6 +16,6 @@ module.exports = { }; ``` -However, while the it's still a pre-release, the underlying schemas CAN contain breaking changes from version to version, up until the AsyncAPI specification is released. This means that one AsyncAPI document using v3 in the pre-release stage might be valid in `6.0.0`, but invalid in the `6.1.0`. This ONLY applies to pre-release schemas, and NOT regular ones that is set in stone. +However, while it's still a pre-release, the underlying schemas CAN contain breaking changes from version to version, up until the AsyncAPI specification is released. This means that one AsyncAPI document using v3 in the pre-release stage might be valid in `6.0.0`, but invalid in the `6.1.0`. This ONLY applies to pre-release schemas, and NOT regular ones that are set in stone. If you want to make sure you don't use a schema not released yet, you have to whitelist which versions you allow in your tool. \ No newline at end of file