diff --git a/package-lock.json b/package-lock.json index f32d70ec..6eead604 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/specs", - "version": "6.0.0", + "version": "6.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@asyncapi/specs", - "version": "6.0.0", + "version": "6.1.0", "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.11" diff --git a/package.json b/package.json index c6af5334..4d06af95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/specs", - "version": "6.0.0", + "version": "6.1.0", "description": "AsyncAPI schema versions", "main": "index.js", "types": "index.d.ts", diff --git a/schemas/3.0.0-without-$id.json b/schemas/3.0.0-without-$id.json index bc4f7974..09cbacd8 100644 --- a/schemas/3.0.0-without-$id.json +++ b/schemas/3.0.0-without-$id.json @@ -1207,45 +1207,6 @@ } ] }, - "mqtt5": { - "properties": { - "bindingVersion": { - "enum": [ - "0.2.0" - ] - } - }, - "allOf": [ - { - "description": "If no bindingVersion specified, use the latest binding", - "if": { - "not": { - "required": [ - "bindingVersion" - ] - } - }, - "then": { - "$ref": "#/definitions/bindings-mqtt5-0.2.0-server" - } - }, - { - "if": { - "required": [ - "bindingVersion" - ], - "properties": { - "bindingVersion": { - "const": "0.2.0" - } - } - }, - "then": { - "$ref": "#/definitions/bindings-mqtt5-0.2.0-server" - } - } - ] - }, "kafka": { "properties": { "bindingVersion": { @@ -1483,7 +1444,7 @@ } }, "bindings-mqtt-0.2.0-server": { - "title": "MQTT server bindings object", + "title": "Server Schema", "description": "This object contains information about the server representation in MQTT.", "type": "object", "additionalProperties": false, @@ -1499,7 +1460,7 @@ }, "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", @@ -1532,40 +1493,6 @@ "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" - } - ] - }, - "bindings-mqtt5-0.2.0-server": { - "title": "Server Schema", - "description": "This object contains information about the server representation in MQTT5.", - "type": "object", - "additionalProperties": false, - "patternProperties": { - "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "#/definitions/specificationExtension" - } - }, - "properties": { "sessionExpiryInterval": { "oneOf": [ { @@ -1579,7 +1506,23 @@ "$ref": "#/definitions/Reference" } ], - "description": "Session Expiry Interval in seconds or a Schema Object containing the definition of the interval." + "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": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Number of bytes or a Schema Object representing the Maximum Packet Size the Client is willing to accept." }, "bindingVersion": { "type": "string", @@ -1591,14 +1534,17 @@ }, "examples": [ { - "sessionExpiryInterval": 60, - "bindingVersion": "0.2.0" - }, - { - "sessionExpiryInterval": { - "type": "integer", - "minimum": 100 + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false }, + "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024, "bindingVersion": "0.2.0" } ] @@ -3633,7 +3579,6 @@ } ] }, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { @@ -3939,6 +3884,46 @@ } }, "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": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "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": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "The topic (channel URI) to be used for a response message." + }, "bindingVersion": { "type": "string", "enum": [ @@ -3950,6 +3935,15 @@ "examples": [ { "bindingVersion": "0.2.0" + }, + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" } ] }, @@ -4607,7 +4601,6 @@ }, "amqp1": {}, "mqtt": {}, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { @@ -6528,7 +6521,6 @@ } ] }, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { @@ -6938,12 +6930,33 @@ "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": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], + "description": "Lifetime of the message in seconds" + }, "bindingVersion": { "type": "string", "enum": [ @@ -6956,6 +6969,7 @@ { "qos": 2, "retain": true, + "messageExpiryInterval": 60, "bindingVersion": "0.2.0" } ] diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index 8f80aaa7..94ec627e 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -1240,45 +1240,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": { @@ -1517,7 +1478,7 @@ }, "http://asyncapi.com/bindings/mqtt/0.2.0/server.json": { "$id": "http://asyncapi.com/bindings/mqtt/0.2.0/server.json", - "title": "MQTT server bindings object", + "title": "Server Schema", "description": "This object contains information about the server representation in MQTT.", "type": "object", "additionalProperties": false, @@ -1533,7 +1494,7 @@ }, "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", @@ -1566,41 +1527,6 @@ "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" - } - ] - }, - "http://asyncapi.com/bindings/mqtt5/0.2.0/server.json": { - "$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": [ { @@ -1614,7 +1540,23 @@ "$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." + "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": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://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", @@ -1626,14 +1568,17 @@ }, "examples": [ { - "sessionExpiryInterval": 60, - "bindingVersion": "0.2.0" - }, - { - "sessionExpiryInterval": { - "type": "integer", - "minimum": 100 + "clientId": "guest", + "cleanSession": true, + "lastWill": { + "topic": "/last-wills", + "qos": 2, + "message": "Guest gone offline.", + "retain": false }, + "keepAlive": 60, + "sessionExpiryInterval": 120, + "maximumPacketSize": 1024, "bindingVersion": "0.2.0" } ] @@ -3687,7 +3632,6 @@ } ] }, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { @@ -3996,6 +3940,46 @@ } }, "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": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://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": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "The topic (channel URI) to be used for a response message." + }, "bindingVersion": { "type": "string", "enum": [ @@ -4007,6 +3991,15 @@ "examples": [ { "bindingVersion": "0.2.0" + }, + { + "contentType": "application/json", + "correlationData": { + "type": "string", + "format": "uuid" + }, + "responseTopic": "application/responses", + "bindingVersion": "0.2.0" } ] }, @@ -4674,7 +4667,6 @@ }, "amqp1": {}, "mqtt": {}, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { @@ -6612,7 +6604,6 @@ } ] }, - "mqtt5": {}, "kafka": { "properties": { "bindingVersion": { @@ -7025,12 +7016,33 @@ "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": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], + "description": "Lifetime of the message in seconds" + }, "bindingVersion": { "type": "string", "enum": [ @@ -7043,6 +7055,7 @@ { "qos": 2, "retain": true, + "messageExpiryInterval": 60, "bindingVersion": "0.2.0" } ]