diff --git a/nats/README.md b/nats/README.md index c8e726e1..24e0dfef 100644 --- a/nats/README.md +++ b/nats/README.md @@ -8,33 +8,26 @@ This document defines how to describe NATS-specific information on AsyncAPI. Current version is `0.1.0`. - ## Server Binding Object - This object MUST NOT contain any properties. Its name is reserved for future use. - - ## Channel Binding Object - This object MUST NOT contain any properties. Its name is reserved for future use. - - ## Operation Binding Object -This object MUST NOT contain any properties. Its name is reserved for future use. - - - - +Field Name | Type | Description +---|:---:|--- +| `queue` | string | Defines the name of the queue to use. It MUST NOT exceed 255 characters. | +| `bindingVersion` | string | The version of this binding. If omitted, "latest" MUST be assumed. | + ## Message Binding Object This object MUST NOT contain any properties. Its name is reserved for future use. diff --git a/nats/json_schemas/operation.json b/nats/json_schemas/operation.json new file mode 100644 index 00000000..d98851e8 --- /dev/null +++ b/nats/json_schemas/operation.json @@ -0,0 +1,33 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/nats/operation.json", + "title": "Operation Schema", + "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" + } + }, + "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" + } + ] +}