UNPKG

@asyncapi/specs

Version:
1,178 lines 416 kB
{ "$id": "http://asyncapi.com/definitions/3.1.0/asyncapi.json", "$schema": "http://json-schema.org/draft-07/schema", "title": "AsyncAPI 3.1.0 schema.", "type": "object", "required": [ "asyncapi", "info" ], "properties": { "id": { "description": "A unique id representing the application.", "type": "string", "format": "uri" }, "asyncapi": { "description": "The AsyncAPI specification version of this document.", "type": "string", "const": "3.1.0" }, "channels": { "$ref": "http://asyncapi.com/definitions/3.1.0/channels.json" }, "components": { "$ref": "http://asyncapi.com/definitions/3.1.0/components.json" }, "defaultContentType": { "description": "Default content type to use when encoding/decoding a message's payload.", "type": "string" }, "info": { "$ref": "http://asyncapi.com/definitions/3.1.0/info.json" }, "operations": { "$ref": "http://asyncapi.com/definitions/3.1.0/operations.json" }, "servers": { "$ref": "http://asyncapi.com/definitions/3.1.0/servers.json" } }, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" } }, "additionalProperties": false, "definitions": { "http://asyncapi.com/definitions/3.1.0/channels.json": { "$id": "http://asyncapi.com/definitions/3.1.0/channels.json", "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", "type": "object", "additionalProperties": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json" }, { "$ref": "http://asyncapi.com/definitions/3.1.0/channel.json" } ] }, "examples": [ { "userSignedUp": { "address": "user.signedup", "messages": { "userSignedUp": { "$ref": "#/components/messages/userSignedUp" } } } } ] }, "http://asyncapi.com/definitions/3.1.0/Reference.json": { "$id": "http://asyncapi.com/definitions/3.1.0/Reference.json", "description": "A simple object to allow referencing other components in the specification, internally and externally.", "type": "object", "required": [ "$ref" ], "properties": { "$ref": { "description": "The reference string.", "$ref": "http://asyncapi.com/definitions/3.1.0/ReferenceObject.json" } }, "examples": [ { "$ref": "#/components/schemas/Pet" } ] }, "http://asyncapi.com/definitions/3.1.0/ReferenceObject.json": { "$id": "http://asyncapi.com/definitions/3.1.0/ReferenceObject.json", "type": "string", "format": "uri-reference" }, "http://asyncapi.com/definitions/3.1.0/channel.json": { "$id": "http://asyncapi.com/definitions/3.1.0/channel.json", "description": "Describes a shared communication channel.", "type": "object", "properties": { "title": { "description": "A human-friendly title for the channel.", "type": "string" }, "description": { "description": "A longer description of the channel. CommonMark is allowed.", "type": "string" }, "address": { "description": "An optional string representation of this channel's address. The address is typically the \"topic name\", \"routing key\", \"event type\", or \"path\". When `null` or absent, it MUST be interpreted as unknown. This is useful when the address is generated dynamically at runtime or can't be known upfront. It MAY contain Channel Address Expressions.", "type": [ "string", "null" ] }, "bindings": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json" }, { "$ref": "http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json" } ] }, "externalDocs": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json" }, { "$ref": "http://asyncapi.com/definitions/3.1.0/externalDocs.json" } ] }, "messages": { "$ref": "http://asyncapi.com/definitions/3.1.0/channelMessages.json" }, "parameters": { "$ref": "http://asyncapi.com/definitions/3.1.0/parameters.json" }, "servers": { "description": "The references of the servers on which this channel is available. If absent or empty then this channel must be available on all servers.", "type": "array", "uniqueItems": true, "items": { "$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json" } }, "summary": { "description": "A brief summary of the channel.", "type": "string" }, "tags": { "description": "A list of tags for logical grouping of channels.", "type": "array", "uniqueItems": true, "items": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.1.0/Reference.json" }, { "$ref": "http://asyncapi.com/definitions/3.1.0/tag.json" } ] } } }, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" } }, "additionalProperties": false, "examples": [ { "address": "users.{userId}", "title": "Users channel", "description": "This channel is used to exchange messages about user events.", "messages": { "userSignedUp": { "$ref": "#/components/messages/userSignedUp" }, "userCompletedOrder": { "$ref": "#/components/messages/userCompletedOrder" } }, "parameters": { "userId": { "$ref": "#/components/parameters/userId" } }, "servers": [ { "$ref": "#/servers/rabbitmqInProd" }, { "$ref": "#/servers/rabbitmqInStaging" } ], "bindings": { "amqp": { "is": "queue", "queue": { "exclusive": true } } }, "tags": [ { "name": "user", "description": "User-related messages" } ], "externalDocs": { "description": "Find more info here", "url": "https://example.com" } } ] }, "http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json": { "$id": "http://asyncapi.com/definitions/3.1.0/channelBindingsObject.json", "description": "Map describing protocol-specific definitions for a channel.", "type": "object", "properties": { "amqp": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.3.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/amqp/0.3.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.3.0" ] } } }, "amqp1": {}, "anypointmq": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.0.1" } } }, "then": { "$ref": "http://asyncapi.com/bindings/anypointmq/0.0.1/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.0.1" ] } } }, "googlepubsub": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.2.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/googlepubsub/0.2.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.2.0" ] } } }, "http": {}, "ibmmq": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.1.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/ibmmq/0.1.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.1.0" ] } } }, "jms": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.0.1" } } }, "then": { "$ref": "http://asyncapi.com/bindings/jms/0.0.1/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.0.1" ] } } }, "kafka": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.5.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.5.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.4.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.4.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.3.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/kafka/0.3.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.5.0", "0.4.0", "0.3.0" ] } } }, "mqtt": {}, "nats": {}, "pulsar": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.1.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/pulsar/0.1.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.1.0" ] } } }, "redis": {}, "sns": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.1.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.1.0" ] } } }, "solace": {}, "sqs": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.2.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.2.0" ] } } }, "stomp": {}, "ws": { "allOf": [ { "description": "If no bindingVersion specified, use the latest binding", "if": { "not": { "required": [ "bindingVersion" ] } }, "then": { "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" } }, { "if": { "required": [ "bindingVersion" ], "properties": { "bindingVersion": { "const": "0.1.0" } } }, "then": { "$ref": "http://asyncapi.com/bindings/websockets/0.1.0/channel.json" } } ], "properties": { "bindingVersion": { "enum": [ "0.1.0" ] } } } }, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.1.0/specificationExtension.json" } }, "additionalProperties": false }, "http://asyncapi.com/bindings/amqp/0.3.0/channel.json": { "$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" } ] }, "http://asyncapi.com/definitions/3.0.0/specificationExtension.json": { "$id": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json", "description": "Any property starting with x- is valid.", "additionalProperties": true, "additionalItems": true }, "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/googlepubsub/0.2.0/channel.json": { "$id": "http://asyncapi.com/bindings/googlepubsub/0.2.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\\.\\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." }, "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" ] } }, "required": [ "schemaSettings" ], "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/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" } }, "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/bindings/jms/0.0.1/channel.json": { "$id": "http://asyncapi.com/bindings/jms/0.0.1/channel.json", "title": "Channel Schema", "description": "This object contains configuration for describing a JMS 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) 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 according to the JMS Provider. Defaults to the channel name." }, "destinationType": { "type": "string", "enum": [ "queue", "fifo-queue" ], "default": "queue", "description": "The type of destination. SHOULD be specified to document the messaging model (point-to-point, or 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-signed-up", "destinationType": "fifo-queue", "bindingVersion": "0.0.1" } ] }, "http://asyncapi.com/bindings/kafka/0.5.0/channel.json": { "$id": "http://asyncapi.com/bindings/kafka/0.5.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." }, "topicConfiguration": { "description": "Topic configuration properties that are relevant for the API.", "type": "object", "additionalProperties": true, "properties": { "cleanup.policy": { "description": "The [`cleanup.policy`](https://kafka.apache.org/documentation/#topicconfigs_cleanup.policy) configuration option.", "type": "array", "items": { "type": "string", "enum": [ "compact", "delete" ] } }, "retention.ms": { "description": "The [`retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_retention.ms) configuration option.", "type": "integer", "minimum": -1 }, "retention.bytes": { "description": "The [`retention.bytes`](https://kafka.apache.org/documentation/#topicconfigs_retention.bytes) configuration option.", "type": "integer", "minimum": -1 }, "delete.retention.ms": { "description": "The [`delete.retention.ms`](https://kafka.apache.org/documentation/#topicconfigs_delete.retention.ms) configuration option.", "type": "integer", "minimum": 0 }, "max.message.bytes": { "description": "The [`max.message.bytes`](https://kafka.apache.org/documentation/#topicconfigs_max.message.bytes) configuration option.",