diff --git a/bindings/mqtt/0.2.0/message.json b/bindings/mqtt/0.2.0/message.json index e2d8f798..40210aaf 100644 --- a/bindings/mqtt/0.2.0/message.json +++ b/bindings/mqtt/0.2.0/message.json @@ -1,16 +1,54 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/mqtt/0.2.0/message.json", + "$id": "http://asyncapi.com/bindings/mqtt/0.0.2/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_]+$": { + "^x-[\\w\\d\\.\\-\\_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { + "payloadFormatIndicator": { + "type": "integer", + "enum": [0, 1], + "description": "1 indicates that the payload is UTF-8 encoded character data. 0 indicates that the payload format is unspecified.", + "default": 0 + }, + "correlationData": { + "oneOf": [ + { + "$ref": "https://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Correlation Data is used by the sender of the request message to identify which request the response message is for when it is received." + }, + "contentType": { + "type": "string", + "description": "String describing the content type of the message payload. This should not conflict with the contentType field of the associated AsyncAPI Message object." + }, + "responseTopic": { + "oneOf": [ + { + "type": "string", + "format": "uri-template", + "minLength": 1 + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "The topic (channel URI) to be used for a response message." + }, + "bindingVersion": { "type": "string", "enum": [ @@ -22,6 +60,15 @@ "examples": [ { "bindingVersion": "0.2.0" + }, + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" } ] -} +} \ No newline at end of file diff --git a/bindings/mqtt/0.2.0/operation.json b/bindings/mqtt/0.2.0/operation.json index ec042529..22df1030 100644 --- a/bindings/mqtt/0.2.0/operation.json +++ b/bindings/mqtt/0.2.0/operation.json @@ -1,24 +1,41 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/mqtt/0.2.0/operation.json", + "$id": "http://asyncapi.com/bindings/mqtt/0.0.2/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_]+$": { + "^x-[\\w\\d\\.\\-\\_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, "properties": { "qos": { "type": "integer", + "enum": [0,1,2], "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." }, + "messageExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0, + "maximum": 4294967295 + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Lifetime of the message in seconds" + }, "bindingVersion": { "type": "string", "enum": [ @@ -31,7 +48,8 @@ { "qos": 2, "retain": true, + "messageExpiryInterval": 60, "bindingVersion": "0.2.0" } ] -} +} \ No newline at end of file diff --git a/bindings/mqtt/0.2.0/server.json b/bindings/mqtt/0.2.0/server.json index d45fdb8e..4cc84fef 100644 --- a/bindings/mqtt/0.2.0/server.json +++ b/bindings/mqtt/0.2.0/server.json @@ -1,23 +1,24 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json", - "title": "MQTT server bindings object", + "$id": "http://asyncapi.com/bindings/mqtt/0.0.2/server.json", + "title": "Server Schema", "description": "This object contains information about the server representation in MQTT.", "type": "object", "additionalProperties": false, "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { + "^x-[\\w\\d\\.\\-\\_]+$": { "$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." + "description": "Whether to create a persistent connection or not. When 'false', the connection will be persistent. This is called clean start in MQTTv5." }, "lastWill": { "type": "object", @@ -46,6 +47,37 @@ "type": "integer", "description": "Interval in seconds of the longest period of time the broker and the client can endure without sending a message." }, + "sessionExpiryInterval": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Interval time in seconds or a Schema Object containing the definition of the interval. The broker maintains a session for a disconnected client until this interval expires." + }, + "maximumPacketSize": { + "oneOf": [ + { + "type": "integer", + "minimum": 1, + "maximum": 4294967295 + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "https://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." + }, "bindingVersion": { "type": "string", "enum": [ @@ -65,7 +97,9 @@ "retain": false }, "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024, "bindingVersion": "0.2.0" } ] -} +} \ No newline at end of file diff --git a/bindings/mqtt5/0.2.0/server.json b/bindings/mqtt5/0.2.0/server.json deleted file mode 100644 index 0ef7db4c..00000000 --- a/bindings/mqtt5/0.2.0/server.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/bindings/mqtt5/0.2.0/server.json", - "title": "Server Schema", - "description": "This object contains information about the server representation in MQTT5.", - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" - } - }, - "properties": { - - "sessionExpiryInterval": { - "oneOf": [ - { - "type": "integer", - "minimum": 0 - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - } - ], - "description": "Session Expiry Interval in seconds or a Schema Object containing the definition of the interval." - }, - "bindingVersion": { - "type": "string", - "enum": [ - "0.2.0" - ], - "description": "The version of this binding. If omitted, 'latest' MUST be assumed." - } - }, - "examples": [ - { - "sessionExpiryInterval": 60, - "bindingVersion": "0.2.0" - }, - { - "sessionExpiryInterval": { - "type": "integer", - "minimum": 100 - }, - "bindingVersion": "0.2.0" - } - ] - } - - \ No newline at end of file diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index bb6f1fe4..490e5b35 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -81,7 +81,6 @@ }, "amqp1": {}, "mqtt": {}, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index 0bbb1e11..44266860 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -115,7 +115,6 @@ } ] }, - "mqtt5": { }, "kafka": { "properties": { "bindingVersion": { diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index 5ed6837f..af9e550b 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -115,7 +115,6 @@ } ] }, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 79343211..c483725e 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -47,41 +47,6 @@ } ] }, - "mqtt5": { - "properties": { - "bindingVersion": { - "enum": ["0.2.0"] - } - }, - "allOf": [ - { - "description": "If no bindingVersion specified, use the latest binding", - "if": { - "not": { - "required": [ - "bindingVersion" - ] - } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/mqtt5/0.2.0/server.json" - } - }, - { - "if": { - "required": [ "bindingVersion" ], - "properties": { - "bindingVersion": { - "const": "0.2.0" - } - } - }, - "then": { - "$ref": "http://asyncapi.com/bindings/mqtt5/0.2.0/server.json" - } - } - ] - }, "kafka": { "properties": { "bindingVersion": {