diff --git a/CODEOWNERS b/CODEOWNERS index 5fc5affa..c0661113 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -8,11 +8,14 @@ * @fmvilas @derberg @dalelane @smoya @char0n @asyncapi-bot-eve +/bindings/anypointmq/ @mboss37 @GeraldLoeffler +/bindings/ibmmq/ @rcoppen +/bindings/jms/ @rcoppen @SrfHead +/bindings/kafka/ @lbroudoux @dalelane +/bindings/googlepubsub/ @whitlockjc +/bindings/solace/ @damaru-inc @CameronRushton +/bindings/pulsar/ @VisualBean +/bindings/sns/ @dpwdec @iancooper +/bindings/sqs/ @dpwdec @iancooper -/bindings/anypointmq/ @GeraldLoeffler -/bindings/ibmmq/ @rcoppen -/bindings/kafka/ @lbroudoux @dalelane -/bindings/googlepubsub/ @whitlockjc -/bindings/solace/ @damaru-inc @CameronRushton -/bindings/*.json @KhudaDad414 -/bindings/pulsar/ @VisualBean \ No newline at end of file +/bindings/*.json @KhudaDad414 \ No newline at end of file diff --git a/bindings/anypointmq/0.0.1/message.json b/bindings/anypointmq/0.0.1/message.json index 16075b90..34dddaa0 100644 --- a/bindings/anypointmq/0.0.1/message.json +++ b/bindings/anypointmq/0.0.1/message.json @@ -12,7 +12,14 @@ }, "properties": { "headers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." }, "bindingVersion": { diff --git a/bindings/http/0.1.0/message.json b/bindings/http/0.1.0/message.json index 7295151a..84fbb679 100644 --- a/bindings/http/0.1.0/message.json +++ b/bindings/http/0.1.0/message.json @@ -12,7 +12,14 @@ }, "properties": { "headers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.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": { diff --git a/bindings/http/0.1.0/operation.json b/bindings/http/0.1.0/operation.json index 61119a7a..8ba6b903 100644 --- a/bindings/http/0.1.0/operation.json +++ b/bindings/http/0.1.0/operation.json @@ -35,7 +35,14 @@ "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", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.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": { diff --git a/bindings/jms/.keep b/bindings/jms/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/bindings/jms/0.0.1/channel.json b/bindings/jms/0.0.1/channel.json new file mode 100644 index 00000000..6e6bde39 --- /dev/null +++ b/bindings/jms/0.0.1/channel.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$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" + } + ] +} diff --git a/bindings/jms/0.0.1/message.json b/bindings/jms/0.0.1/message.json new file mode 100644 index 00000000..daad663f --- /dev/null +++ b/bindings/jms/0.0.1/message.json @@ -0,0 +1,73 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/jms/0.0.1/message.json", + "title": "Message Schema", + "description": "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", + "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": "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + + }, + "examples": [ + { + "headers": { + "type": "object", + "required": ["JMSMessageID"], + "properties": { + "JMSMessageID": { + "type": ["string", "null"], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": ["PERSISTENT", "NON_PERSISTENT"], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": ["string", "null"], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": ["string", "null"], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + }, + "bindingVersion": "0.0.1" + } + ] +} diff --git a/bindings/jms/0.0.1/server.json b/bindings/jms/0.0.1/server.json new file mode 100644 index 00000000..2137b913 --- /dev/null +++ b/bindings/jms/0.0.1/server.json @@ -0,0 +1,69 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/jms/0.0.1/server.json", + "title": "Server Schema", + "description": "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "required": ["jmsConnectionFactory"], + "properties": { + "jmsConnectionFactory": { + "type": "string", + "description": "The classname of the ConnectionFactory implementation for the JMS Provider." + }, + "properties": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property" + }, + "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." + }, + "clientID": { + "type": "string", + "description": "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + + }, + "definitions": { + "property": { + "type": "object", + "required": ["name", "value"], + "properties": { + "name": { + "type": "string", + "description": "The name of a property" + }, + "value": { + "type": ["string", "boolean", "number", "null"], + "description": "The name of a property" + } + } + } + }, + "examples": [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1", + "bindingVersion": "0.0.1" + } + ] + } + \ No newline at end of file diff --git a/bindings/sns/.keep b/bindings/sns/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/bindings/sns/0.1.0/channel.json b/bindings/sns/0.1.0/channel.json new file mode 100644 index 00000000..552b63e0 --- /dev/null +++ b/bindings/sns/0.1.0/channel.json @@ -0,0 +1,150 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/sns/0.1.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + "ordering": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/ordering" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the topic." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "name" + ], + "definitions": { + "ordering": { + "type": "object", + "description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "type": { + "type": "string", + "description": "Defines the type of SNS Topic.", + "enum": [ + "standard", + "FIFO" + ] + }, + "contentBasedDeduplication": { + "type": "boolean", + "description": "True to turn on de-duplication of messages for a channel." + } + }, + "required": [ + "type" + ] + }, + "policy": { + "type": "object", + "description": "The security policy for the SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this topic", + "items": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SNS permission being allowed or denied e.g. sns:Publish", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ] +} diff --git a/bindings/sns/0.1.0/operation.json b/bindings/sns/0.1.0/operation.json new file mode 100644 index 00000000..4c890902 --- /dev/null +++ b/bindings/sns/0.1.0/operation.json @@ -0,0 +1,273 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/sns/0.1.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "topic": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + "consumers": { + "type": "array", + "description": "The protocols that listen to this topic and their endpoints.", + "items": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/consumer" + }, + "minItems": 1 + }, + "deliveryPolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "consumers" + ], + "definitions": { + "identifier": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "url": { + "type": "string", + "description": "The endpoint is a URL." + }, + "email": { + "type": "string", + "description": "The endpoint is an email address." + }, + "phone": { + "type": "string", + "description": "The endpoint is a phone number." + }, + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + "consumer": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "protocol": { + "description": "The protocol that this endpoint receives messages by.", + "type": "string", + "enum": [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + "endpoint": { + "description": "The endpoint messages are delivered to.", + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier" + }, + "filterPolicy": { + "type": "object", + "description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "filterPolicyScope": { + "type": "string", + "description": "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + "enum": [ + "MessageAttributes", + "MessageBody" + ], + "default": "MessageAttributes" + }, + "rawMessageDelivery": { + "type": "boolean", + "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/redrivePolicy" + }, + "deliveryPolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + "displayName": { + "type": "string", + "description": "The display name to use with an SNS subscription" + } + }, + "required": [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + "deliveryPolicy": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "minDelayTarget": { + "type": "integer", + "description": "The minimum delay for a retry in seconds." + }, + "maxDelayTarget": { + "type": "integer", + "description": "The maximum delay for a retry in seconds." + }, + "numRetries": { + "type": "integer", + "description": "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + "numNoDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with no delay)." + }, + "numMinDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with delay)." + }, + "numMaxDelayRetries": { + "type": "integer", + "description": "The number of post-backoff phase retries, with the maximum delay between retries." + }, + "backoffFunction": { + "type": "string", + "description": "The algorithm for backoff between retries.", + "enum": [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + "maxReceivesPerSecond": { + "type": "integer", + "description": "The maximum number of deliveries per second, per subscription." + } + } + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + "description": "The SQS queue to use as a dead letter queue (DLQ)." + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + } + }, + "examples": [ + { + "topic": { + "name": "someTopic" + }, + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicy": { + "store": [ + "asyncapi_corp" + ], + "event": [ + { + "anything-but": "order_cancelled" + } + ], + "customer_interests": [ + "rugby", + "football", + "baseball" + ] + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] + } + ] +} diff --git a/bindings/sqs/.keep b/bindings/sqs/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/bindings/sqs/0.2.0/channel.json b/bindings/sqs/0.2.0/channel.json new file mode 100644 index 00000000..91431157 --- /dev/null +++ b/bindings/sqs/0.2.0/channel.json @@ -0,0 +1,264 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "queue": { + "description": "A definition of the queue that will be used as the channel.", + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + "deadLetterQueue": { + "description": "A definition of the queue that will be used for un-processable messages.", + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queue" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": ["queue", "messageGroup"], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": ["perQueue", "perMessageGroupId"], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/redrivePolicy" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name", + "fifoQueue" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ] +} \ No newline at end of file diff --git a/bindings/sqs/0.2.0/operation.json b/bindings/sqs/0.2.0/operation.json new file mode 100644 index 00000000..f25d4423 --- /dev/null +++ b/bindings/sqs/0.2.0/operation.json @@ -0,0 +1,258 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "queues": { + "type": "array", + "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/queue" + } + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queues" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "$ref": { + "type": "string", + "description": "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": ["queue", "messageGroup"], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": ["perQueue", "perMessageGroupId"], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/redrivePolicy" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] + } + ] +} diff --git a/bindings/websockets/0.1.0/channel.json b/bindings/websockets/0.1.0/channel.json index d01abd46..4fa27b0f 100644 --- a/bindings/websockets/0.1.0/channel.json +++ b/bindings/websockets/0.1.0/channel.json @@ -20,11 +20,25 @@ "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." }, "query": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." }, "headers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." }, "bindingVersion": { diff --git a/definitions/3.0.0/APIKeyHTTPSecurityScheme.json b/definitions/3.0.0/APIKeyHTTPSecurityScheme.json index d1472015..33dee593 100644 --- a/definitions/3.0.0/APIKeyHTTPSecurityScheme.json +++ b/definitions/3.0.0/APIKeyHTTPSecurityScheme.json @@ -8,15 +8,18 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "httpApiKey" ] }, "name": { - "type": "string" + "type": "string", + "description": "The name of the header, query or cookie parameter to be used." }, "in": { "type": "string", + "description": "The location of the API key", "enum": [ "header", "query", @@ -24,7 +27,8 @@ ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -32,6 +36,9 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/APIKeyHTTPSecurityScheme.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/APIKeyHTTPSecurityScheme.json" diff --git a/definitions/3.0.0/BearerHTTPSecurityScheme.json b/definitions/3.0.0/BearerHTTPSecurityScheme.json index 7a247c3a..3f71902b 100644 --- a/definitions/3.0.0/BearerHTTPSecurityScheme.json +++ b/definitions/3.0.0/BearerHTTPSecurityScheme.json @@ -7,21 +7,25 @@ "properties": { "scheme": { "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", "enum": [ "bearer" ] }, "bearerFormat": { - "type": "string" + "type": "string", + "description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." }, "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "http" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { diff --git a/definitions/3.0.0/NonBearerHTTPSecurityScheme.json b/definitions/3.0.0/NonBearerHTTPSecurityScheme.json index eeadb2d8..3f1a8d76 100644 --- a/definitions/3.0.0/NonBearerHTTPSecurityScheme.json +++ b/definitions/3.0.0/NonBearerHTTPSecurityScheme.json @@ -4,6 +4,7 @@ "properties": { "scheme": { "type": "string", + "description": "A short description for security scheme.", "enum": [ "bearer" ] @@ -17,13 +18,16 @@ ], "properties": { "scheme": { - "type": "string" + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." }, "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "http" ] diff --git a/definitions/3.0.0/Reference.json b/definitions/3.0.0/Reference.json index f9e9893a..78f41b69 100644 --- a/definitions/3.0.0/Reference.json +++ b/definitions/3.0.0/Reference.json @@ -1,13 +1,18 @@ { "type": "object", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", "required": [ "$ref" ], "properties": { "$ref": { + "description": "The reference string.", "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/ReferenceObject.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/Reference.json" } \ No newline at end of file diff --git a/definitions/3.0.0/SaslGssapiSecurityScheme.json b/definitions/3.0.0/SaslGssapiSecurityScheme.json index f3ef3f35..eb65dcc8 100644 --- a/definitions/3.0.0/SaslGssapiSecurityScheme.json +++ b/definitions/3.0.0/SaslGssapiSecurityScheme.json @@ -6,12 +6,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "gssapi" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -19,6 +21,9 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json" diff --git a/definitions/3.0.0/SaslPlainSecurityScheme.json b/definitions/3.0.0/SaslPlainSecurityScheme.json index 6de1b832..e461874f 100644 --- a/definitions/3.0.0/SaslPlainSecurityScheme.json +++ b/definitions/3.0.0/SaslPlainSecurityScheme.json @@ -6,12 +6,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme. Valid values", "enum": [ "plain" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -19,7 +21,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/SaslPlainSecurityScheme.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/SaslScramSecurityScheme.json b/definitions/3.0.0/SaslScramSecurityScheme.json index b7b9fc36..6d1f850b 100644 --- a/definitions/3.0.0/SaslScramSecurityScheme.json +++ b/definitions/3.0.0/SaslScramSecurityScheme.json @@ -6,13 +6,15 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "scramSha256", "scramSha512" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -20,7 +22,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/Sasl.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/SecurityScheme.json b/definitions/3.0.0/SecurityScheme.json index ee6b9f70..83573217 100644 --- a/definitions/3.0.0/SecurityScheme.json +++ b/definitions/3.0.0/SecurityScheme.json @@ -1,4 +1,5 @@ { + "description": "Defines a security scheme that can be used by the operations.", "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/userPassword.json" @@ -28,6 +29,9 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json" } ], + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/SecurityScheme.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json" } \ No newline at end of file diff --git a/definitions/3.0.0/X509.json b/definitions/3.0.0/X509.json index 059a1ca0..004db984 100644 --- a/definitions/3.0.0/X509.json +++ b/definitions/3.0.0/X509.json @@ -19,7 +19,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/X509.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/X509.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/anySchema.json b/definitions/3.0.0/anySchema.json index e8e2cb7f..4a0bf239 100644 --- a/definitions/3.0.0/anySchema.json +++ b/definitions/3.0.0/anySchema.json @@ -1,16 +1,16 @@ { - "if": { - "required": [ - "schema" - ] - }, - "then": { - "$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" - }, - "else": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" - }, - "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.", - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json" -} \ No newline at end of file + "if": { + "required": [ + "schema" + ] + }, + "then": { + "$ref": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json" + }, + "else": { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise.", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json" +} diff --git a/definitions/3.0.0/apiKey.json b/definitions/3.0.0/apiKey.json index dd4b8af8..daec7eaf 100644 --- a/definitions/3.0.0/apiKey.json +++ b/definitions/3.0.0/apiKey.json @@ -7,19 +7,22 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme", "enum": [ "apiKey" ] }, "in": { "type": "string", + "description": " The location of the API key.", "enum": [ "user", "password" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -27,7 +30,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/apiKey.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/apiKey.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/asymmetricEncryption.json b/definitions/3.0.0/asymmetricEncryption.json index 58ef8eb1..b52c5dff 100644 --- a/definitions/3.0.0/asymmetricEncryption.json +++ b/definitions/3.0.0/asymmetricEncryption.json @@ -6,12 +6,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "asymmetricEncryption" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { diff --git a/definitions/3.0.0/asyncapi.json b/definitions/3.0.0/asyncapi.json index 18a6c39d..0af21643 100644 --- a/definitions/3.0.0/asyncapi.json +++ b/definitions/3.0.0/asyncapi.json @@ -31,7 +31,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/servers.json" }, "defaultContentType": { - "type": "string" + "type": "string", + "description": "Default content type to use when encoding/decoding a message's payload." }, "channels": { "$ref": "http://asyncapi.com/definitions/3.0.0/channels.json" diff --git a/definitions/3.0.0/channel.json b/definitions/3.0.0/channel.json index 22a3c4b6..35567b6d 100644 --- a/definitions/3.0.0/channel.json +++ b/definitions/3.0.0/channel.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Describes a shared communication channel.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -39,32 +40,43 @@ }, "tags": { "type": "array", + "description": "A list of tags for logical grouping of channels.", "items": { "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" - } - ] + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] }, "uniqueItems": true }, "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "bindings": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" } ] - }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/channel.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/channel.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/channelBindingsObject.json b/definitions/3.0.0/channelBindingsObject.json index 21ba2f2c..bb6f1fe4 100644 --- a/definitions/3.0.0/channelBindingsObject.json +++ b/definitions/3.0.0/channelBindingsObject.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Map describing protocol-specific definitions for a channel.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -165,9 +166,111 @@ ] }, "nats": {}, - "jms": {}, - "sns": {}, - "sqs": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": ["0.0.1"] + } + }, + "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" + } + } + ] + }, + "sns": { + "properties": { + "bindingVersion": { + "enum": ["0.1.0"] + } + }, + "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" + } + } + ] + }, + "sqs": { + "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/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" + } + } + ] + }, "stomp": {}, "redis": {}, "ibmmq": { diff --git a/definitions/3.0.0/channels.json b/definitions/3.0.0/channels.json index a4f4e89d..4169cfc3 100644 --- a/definitions/3.0.0/channels.json +++ b/definitions/3.0.0/channels.json @@ -1,15 +1,19 @@ { "type": "object", + "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", "additionalProperties": { "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" } ] }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/channels.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/channels.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/components.json b/definitions/3.0.0/components.json index 3f3589ef..2d7b5e2f 100644 --- a/definitions/3.0.0/components.json +++ b/definitions/3.0.0/components.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -10,6 +10,7 @@ "properties": { "schemas": { "type": "object", + "description": "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -25,6 +26,7 @@ }, "servers": { "type": "object", + "description": "An object to hold reusable Server Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -40,6 +42,7 @@ }, "channels": { "type": "object", + "description": "An object to hold reusable Channel Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -55,6 +58,7 @@ }, "serverVariables": { "type": "object", + "description": "An object to hold reusable Server Variable Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -68,8 +72,24 @@ } } }, + "operations": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + } + ] + } + } + }, "messages": { "type": "object", + "description": "An object to hold reusable Message Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -85,6 +105,7 @@ }, "securitySchemes": { "type": "object", + "description": "An object to hold reusable Security Scheme Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -100,6 +121,7 @@ }, "parameters": { "type": "object", + "description": "An object to hold reusable Parameter Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -115,6 +137,7 @@ }, "correlationIds": { "type": "object", + "description": "An object to hold reusable Correlation ID Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -130,6 +153,7 @@ }, "operationTraits": { "type": "object", + "description": "An object to hold reusable Operation Trait Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -145,6 +169,7 @@ }, "messageTraits": { "type": "object", + "description": "An object to hold reusable Message Trait Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -160,6 +185,7 @@ }, "replies": { "type": "object", + "description": "An object to hold reusable Operation Reply Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -175,6 +201,7 @@ }, "replyAddresses": { "type": "object", + "description": "An object to hold reusable Operation Reply Address Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -190,6 +217,7 @@ }, "serverBindings": { "type": "object", + "description": "An object to hold reusable Server Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -205,6 +233,7 @@ }, "channelBindings": { "type": "object", + "description": "An object to hold reusable Channel Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -220,6 +249,7 @@ }, "operationBindings": { "type": "object", + "description": "An object to hold reusable Operation Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -235,6 +265,7 @@ }, "messageBindings": { "type": "object", + "description": "An object to hold reusable Message Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -250,6 +281,7 @@ }, "tags": { "type": "object", + "description": "An object to hold reusable Tag Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -265,6 +297,7 @@ }, "externalDocs": { "type": "object", + "description": "An object to hold reusable External Documentation Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -279,6 +312,9 @@ } } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/components.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/components.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/contact.json b/definitions/3.0.0/contact.json index ec226020..5356d4e2 100644 --- a/definitions/3.0.0/contact.json +++ b/definitions/3.0.0/contact.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "Contact information for the owners of the API.", + "description": "Contact information for the exposed API.", "additionalProperties": false, "properties": { "name": { @@ -23,6 +23,9 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/contact.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/contact.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/correlationId.json b/definitions/3.0.0/correlationId.json index 03d0a514..18aa99a2 100644 --- a/definitions/3.0.0/correlationId.json +++ b/definitions/3.0.0/correlationId.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", "required": [ "location" ], @@ -20,6 +21,9 @@ "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/correlationId.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/externalDocs.json b/definitions/3.0.0/externalDocs.json index 0a20754f..3ab83718 100644 --- a/definitions/3.0.0/externalDocs.json +++ b/definitions/3.0.0/externalDocs.json @@ -1,16 +1,18 @@ { "type": "object", "additionalProperties": false, - "description": "information about external documentation", + "description": "Allows referencing an external resource for extended documentation.", "required": [ "url" ], "properties": { "description": { - "type": "string" + "type": "string", + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation." }, "url": { "type": "string", + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", "format": "uri" } }, @@ -19,6 +21,9 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/externalDocs.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/info.json b/definitions/3.0.0/info.json index bf8c1491..6c9b70fa 100644 --- a/definitions/3.0.0/info.json +++ b/definitions/3.0.0/info.json @@ -1,6 +1,6 @@ { "type": "object", - "description": "General information about the API.", + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", "required": [ "version", "title" @@ -37,6 +37,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", "items": { "oneOf": [ { @@ -60,6 +61,9 @@ ] } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/info.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/info.json" } \ No newline at end of file diff --git a/definitions/3.0.0/license.json b/definitions/3.0.0/license.json index 391692c9..06a5518e 100644 --- a/definitions/3.0.0/license.json +++ b/definitions/3.0.0/license.json @@ -1,8 +1,6 @@ { "type": "object", - "required": [ - "name" - ], + "required": ["name"], "additionalProperties": false, "properties": { "name": { @@ -17,9 +15,12 @@ }, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { - "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/license.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/license.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/messageBindingsObject.json b/definitions/3.0.0/messageBindingsObject.json index 89fb8071..0bbb1e11 100644 --- a/definitions/3.0.0/messageBindingsObject.json +++ b/definitions/3.0.0/messageBindingsObject.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Map describing protocol-specific definitions for a message.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -199,7 +200,41 @@ ] }, "nats": {}, - "jms": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": ["0.0.1"] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + }, + { + "if": { + "required": [ "bindingVersion" ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + } + ] + }, "sns": {}, "sqs": {}, "stomp": {}, diff --git a/definitions/3.0.0/messageObject.json b/definitions/3.0.0/messageObject.json index 87c066f3..3c35a299 100644 --- a/definitions/3.0.0/messageObject.json +++ b/definitions/3.0.0/messageObject.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Describes a message received on a given channel and operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -8,7 +9,8 @@ }, "properties": { "contentType": { - "type": "string" + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." }, "headers": { "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" @@ -72,6 +74,7 @@ }, "examples": { "type": "array", + "description": "List of examples.", "items": { "type": "object", "additionalProperties": false, @@ -107,10 +110,18 @@ } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] }, "traits": { "type": "array", + "description": "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", "items": { "oneOf": [ { @@ -142,6 +153,9 @@ } } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/messageObject.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/messageObject.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/messageTrait.json b/definitions/3.0.0/messageTrait.json index 86717cf0..587d140b 100644 --- a/definitions/3.0.0/messageTrait.json +++ b/definitions/3.0.0/messageTrait.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -8,7 +9,8 @@ }, "properties": { "contentType": { - "type": "string" + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." }, "headers": { "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" @@ -69,14 +71,25 @@ }, "examples": { "type": "array", + "description": "List of examples.", "items": { "type": "object" } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/messageTrait.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/multiFormatSchema.json b/definitions/3.0.0/multiFormatSchema.json index fa993a10..d4047bb0 100644 --- a/definitions/3.0.0/multiFormatSchema.json +++ b/definitions/3.0.0/multiFormatSchema.json @@ -1,4 +1,5 @@ { + "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", "if": { "not": { "type": "object" @@ -17,6 +18,7 @@ }, "properties": { "schemaFormat": { + "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", "anyOf": [ { "type": "string" @@ -48,7 +50,9 @@ } ] }, - "schema": {} + "schema": { + "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." + } }, "allOf": [ { diff --git a/definitions/3.0.0/oauth2Flow.json b/definitions/3.0.0/oauth2Flow.json index d3ca471b..ef1e7c95 100644 --- a/definitions/3.0.0/oauth2Flow.json +++ b/definitions/3.0.0/oauth2Flow.json @@ -1,20 +1,25 @@ { "type": "object", + "description": "Configuration details for a supported OAuth Flow", "properties": { "authorizationUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." }, "tokenUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL." }, "refreshUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." }, "availableScopes": { - "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." } }, "patternProperties": { @@ -22,7 +27,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/oauth2Flow.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/oauth2Flows.json b/definitions/3.0.0/oauth2Flows.json index 735806c8..3cb9cecf 100644 --- a/definitions/3.0.0/oauth2Flows.json +++ b/definitions/3.0.0/oauth2Flows.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Allows configuration of the supported OAuth Flows.", "required": [ "type", "flows" @@ -7,17 +8,20 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "oauth2" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." }, "flows": { "type": "object", "properties": { "implicit": { + "description": "Configuration for the OAuth Implicit flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -38,6 +42,7 @@ ] }, "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -58,6 +63,7 @@ ] }, "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -78,6 +84,7 @@ ] }, "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -109,4 +116,4 @@ }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/openIdConnect.json b/definitions/3.0.0/openIdConnect.json index 2150ba4d..41b65f5d 100644 --- a/definitions/3.0.0/openIdConnect.json +++ b/definitions/3.0.0/openIdConnect.json @@ -7,20 +7,23 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "openIdConnect" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." }, "openIdConnectUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." }, "scopes": { "type": "array", - "description": "List of the needed scope names.", + "description": "List of the needed scope names. An empty array means no scopes are needed.", "items": { "type": "string" } diff --git a/definitions/3.0.0/operation.json b/definitions/3.0.0/operation.json index 3bcf7fea..529cfbc5 100644 --- a/definitions/3.0.0/operation.json +++ b/definitions/3.0.0/operation.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Describes a specific operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -21,6 +22,7 @@ }, "messages": { "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" } @@ -37,6 +39,7 @@ }, "traits": { "type": "array", + "description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", "items": { "oneOf": [ { @@ -65,6 +68,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", "items": { "oneOf": [ { @@ -88,9 +92,19 @@ ] }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/operation.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operation.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/operationBindingsObject.json b/definitions/3.0.0/operationBindingsObject.json index cb56be5f..5ed6837f 100644 --- a/definitions/3.0.0/operationBindingsObject.json +++ b/definitions/3.0.0/operationBindingsObject.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Map describing protocol-specific definitions for an operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -200,8 +201,76 @@ ] }, "jms": {}, - "sns": {}, - "sqs": {}, + "sns": { + "properties": { + "bindingVersion": { + "enum": ["0.1.0"] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + }, + { + "if": { + "required": [ "bindingVersion" ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + } + ] + }, + "sqs": { + "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/sqs/0.2.0/operation.json" + } + }, + { + "if": { + "required": [ "bindingVersion" ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + } + ] + }, "stomp": {}, "redis": {}, "ibmmq": {}, diff --git a/definitions/3.0.0/operationReply.json b/definitions/3.0.0/operationReply.json index 2cf7c0e9..fe1491d9 100644 --- a/definitions/3.0.0/operationReply.json +++ b/definitions/3.0.0/operationReply.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -22,6 +23,7 @@ }, "messages": { "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" } diff --git a/definitions/3.0.0/operationReplyAddress.json b/definitions/3.0.0/operationReplyAddress.json index dd7d0e2c..ba29ea12 100644 --- a/definitions/3.0.0/operationReplyAddress.json +++ b/definitions/3.0.0/operationReplyAddress.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "An object that specifies where an operation has to send the reply", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -20,6 +21,9 @@ "description": "An optional description of the address. CommonMark is allowed." } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/operationReplyAddress.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/operationTrait.json b/definitions/3.0.0/operationTrait.json index 986f4796..b646001f 100644 --- a/definitions/3.0.0/operationTrait.json +++ b/definitions/3.0.0/operationTrait.json @@ -1,5 +1,6 @@ -{ +{ "type": "object", + "description": "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -8,27 +9,44 @@ }, "properties": { "title": { + "description": "A human-friendly title for the operation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/title" }, "summary": { + "description": "A short summary of what the operation is about.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" }, "description": { + "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description" }, "security": { + "description": "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" }, "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" }, "externalDocs": { + "description": "Additional external documentation for this operation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/bindings" + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/operationTrait.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/operations.json b/definitions/3.0.0/operations.json index 7d44877f..7ca51c39 100644 --- a/definitions/3.0.0/operations.json +++ b/definitions/3.0.0/operations.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Holds a dictionary with all the operations this application MUST implement.", "additionalProperties": { "oneOf": [ { @@ -10,6 +11,9 @@ } ] }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/operations.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/operations.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/parameter.json b/definitions/3.0.0/parameter.json index f483a9c9..996b6817 100644 --- a/definitions/3.0.0/parameter.json +++ b/definitions/3.0.0/parameter.json @@ -1,4 +1,5 @@ { + "description": "Describes a parameter included in a channel address.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -11,18 +12,18 @@ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "enum": { - "description": "A list of allowed values for the parameter.", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", "type": "array", "items": { "type": "string" } }, "default": { - "description": "The default value to use for the parameter.", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", "type": "string" }, "examples": { - "description": "List of example values to use for the parameter.", + "description": "An array of examples of the parameter value.", "type": "array", "items": { "type": "string" @@ -34,6 +35,9 @@ "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/parameter.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/parameter.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/parameters.json b/definitions/3.0.0/parameters.json index 19193781..406e7a53 100644 --- a/definitions/3.0.0/parameters.json +++ b/definitions/3.0.0/parameters.json @@ -11,6 +11,9 @@ ] }, "description": "JSON objects describing re-usable channel parameters.", + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/parameters.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/parameters.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/schema.json b/definitions/3.0.0/schema.json index 7f08ab44..054bbc9b 100644 --- a/definitions/3.0.0/schema.json +++ b/definitions/3.0.0/schema.json @@ -1,4 +1,5 @@ { + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", "allOf": [ { "$ref": "http://json-schema.org/draft-07/schema#" @@ -81,7 +82,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" }, "discriminator": { - "type": "string" + "type": "string", + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." }, "externalDocs": { "oneOf": [ @@ -95,6 +97,7 @@ }, "deprecated": { "type": "boolean", + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", "default": false } } diff --git a/definitions/3.0.0/server.json b/definitions/3.0.0/server.json index 17540811..f51dc063 100644 --- a/definitions/3.0.0/server.json +++ b/definitions/3.0.0/server.json @@ -1,24 +1,21 @@ { "type": "object", - "description": "An object representing a Server.", - "required": [ - "host", - "protocol" - ], + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", + "required": ["host", "protocol"], "additionalProperties": false, - "patternProperties": { + "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "properties": { + "properties": { "host": { "type": "string", - "description": "The server host name." + "description": "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." }, "pathname": { "type": "string", - "description": "The path to a resource in the host." + "description": "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." }, "title": { "type": "string", @@ -34,10 +31,11 @@ }, "protocol": { "type": "string", - "description": "The transfer protocol." + "description": "The protocol this server supports for connection." }, "protocolVersion": { - "type": "string" + "type": "string", + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." }, "variables": { "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json" @@ -49,30 +47,40 @@ "type": "array", "items": { "oneOf": [ - { - "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" - }, - { - "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" - } - ] + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/tag.json" + } + ] }, "uniqueItems": true }, "externalDocs": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + } + ] + }, + "bindings": { "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/externalDocs.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } ] - }, - "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/server.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/server.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/serverBindingsObject.json b/definitions/3.0.0/serverBindingsObject.json index 5782a1c5..79343211 100644 --- a/definitions/3.0.0/serverBindingsObject.json +++ b/definitions/3.0.0/serverBindingsObject.json @@ -1,5 +1,6 @@ { "type": "object", + "description": "Map describing protocol-specific definitions for a server.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -131,7 +132,41 @@ }, "anypointmq": {}, "nats": {}, - "jms": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": ["0.0.1"] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + }, + { + "if": { + "required": [ "bindingVersion" ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + } + ] + }, "sns": {}, "sqs": {}, "stomp": {}, diff --git a/definitions/3.0.0/serverVariable.json b/definitions/3.0.0/serverVariable.json index 9ef8f966..1bcc5090 100644 --- a/definitions/3.0.0/serverVariable.json +++ b/definitions/3.0.0/serverVariable.json @@ -10,24 +10,31 @@ "properties": { "enum": { "type": "array", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", "items": { "type": "string" }, - "uniqueItems": true + "uniqueItems": true }, - "default": { - "type": "string" - }, - "description": { - "type": "string" - }, - "examples": { - "type": "array", - "items": { - "type": "string" - } - } + "default": { + "type": "string", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied." + }, + "description": { + "type": "string", + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." + }, + "examples": { + "type": "array", + "description": "An array of examples of the server variable.", + "items": { + "type": "string" + } + } + }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/serverVariable.json" }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/serverVariable.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/servers.json b/definitions/3.0.0/servers.json index 921b4ed4..9c6e9486 100644 --- a/definitions/3.0.0/servers.json +++ b/definitions/3.0.0/servers.json @@ -7,10 +7,13 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" }, { - "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" } ] }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/servers.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/servers.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/symmetricEncryption.json b/definitions/3.0.0/symmetricEncryption.json index 4fb69278..5cc61ef2 100644 --- a/definitions/3.0.0/symmetricEncryption.json +++ b/definitions/3.0.0/symmetricEncryption.json @@ -19,7 +19,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/symmetricEncryption.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/tag.json b/definitions/3.0.0/tag.json index 135fd63b..2e5ab3ea 100644 --- a/definitions/3.0.0/tag.json +++ b/definitions/3.0.0/tag.json @@ -1,15 +1,18 @@ { "type": "object", + "description": "Allows adding metadata to a single tag.", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { - "type": "string" + "type": "string", + "description": "The name of the tag." }, "description": { - "type": "string" + "type": "string", + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation." }, "externalDocs": { "oneOf": [ @@ -27,6 +30,9 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/tag.json" + }, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/tag.json" -} \ No newline at end of file +} diff --git a/definitions/3.0.0/userPassword.json b/definitions/3.0.0/userPassword.json index aeaa22d0..21a2b65a 100644 --- a/definitions/3.0.0/userPassword.json +++ b/definitions/3.0.0/userPassword.json @@ -19,7 +19,10 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "example": { + "$ref": "http://asyncapi.com/examples/3.0.0/userPassword.json" + }, "additionalProperties": false, "$schema": "http://json-schema.org/draft-07/schema#", "$id": "http://asyncapi.com/definitions/3.0.0/userPassword.json" -} \ No newline at end of file +} diff --git a/examples/3.0.0/APIKeyHTTPSecurityScheme.json b/examples/3.0.0/APIKeyHTTPSecurityScheme.json new file mode 100644 index 00000000..e1bddc93 --- /dev/null +++ b/examples/3.0.0/APIKeyHTTPSecurityScheme.json @@ -0,0 +1,7 @@ +[ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } +] \ No newline at end of file diff --git a/examples/3.0.0/ReferenceObject.json b/examples/3.0.0/ReferenceObject.json new file mode 100644 index 00000000..1bc58e64 --- /dev/null +++ b/examples/3.0.0/ReferenceObject.json @@ -0,0 +1,3 @@ +[{ + "$ref": "#/components/schemas/Pet" +}] \ No newline at end of file diff --git a/examples/3.0.0/Sasl.json b/examples/3.0.0/Sasl.json new file mode 100644 index 00000000..85ea380b --- /dev/null +++ b/examples/3.0.0/Sasl.json @@ -0,0 +1,5 @@ +[ + { + "type": "scramSha512" + } +] \ No newline at end of file diff --git a/examples/3.0.0/SecurityScheme.json b/examples/3.0.0/SecurityScheme.json new file mode 100644 index 00000000..eb52bb8b --- /dev/null +++ b/examples/3.0.0/SecurityScheme.json @@ -0,0 +1,5 @@ +[ + { + "type": "userPassword" + } +] \ No newline at end of file diff --git a/examples/3.0.0/X509.json b/examples/3.0.0/X509.json new file mode 100644 index 00000000..690ba0a2 --- /dev/null +++ b/examples/3.0.0/X509.json @@ -0,0 +1,5 @@ +[ + { + "type": "X509" + } +] \ No newline at end of file diff --git a/examples/3.0.0/apiKey.json b/examples/3.0.0/apiKey.json new file mode 100644 index 00000000..5ae19cc0 --- /dev/null +++ b/examples/3.0.0/apiKey.json @@ -0,0 +1,6 @@ +[ + { + "type": "apiKey", + "in": "user" + } +] diff --git a/examples/3.0.0/channel.json b/examples/3.0.0/channel.json new file mode 100644 index 00000000..0fc0dab0 --- /dev/null +++ b/examples/3.0.0/channel.json @@ -0,0 +1,40 @@ +[{ + "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" + } +}] \ No newline at end of file diff --git a/examples/3.0.0/channels.json b/examples/3.0.0/channels.json new file mode 100644 index 00000000..b9aeb6a6 --- /dev/null +++ b/examples/3.0.0/channels.json @@ -0,0 +1,12 @@ +[ + { + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } +] diff --git a/examples/3.0.0/components.json b/examples/3.0.0/components.json new file mode 100644 index 00000000..c0331a88 --- /dev/null +++ b/examples/3.0.0/components.json @@ -0,0 +1,130 @@ +[{ + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "description": "RabbitMQ broker", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": ["5671", "5672"], + "default": "5672" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } +}] \ No newline at end of file diff --git a/examples/3.0.0/contact.json b/examples/3.0.0/contact.json new file mode 100644 index 00000000..1c81a963 --- /dev/null +++ b/examples/3.0.0/contact.json @@ -0,0 +1,8 @@ +[ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + +] \ No newline at end of file diff --git a/examples/3.0.0/correlationId.json b/examples/3.0.0/correlationId.json new file mode 100644 index 00000000..82d8a96e --- /dev/null +++ b/examples/3.0.0/correlationId.json @@ -0,0 +1,4 @@ +[{ + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" +}] \ No newline at end of file diff --git a/examples/3.0.0/externalDocs.json b/examples/3.0.0/externalDocs.json new file mode 100644 index 00000000..18c3766a --- /dev/null +++ b/examples/3.0.0/externalDocs.json @@ -0,0 +1,4 @@ +[{ + "description": "Find more info here", + "url": "https://example.com" +}] \ No newline at end of file diff --git a/examples/3.0.0/info.json b/examples/3.0.0/info.json new file mode 100644 index 00000000..26bcdf95 --- /dev/null +++ b/examples/3.0.0/info.json @@ -0,0 +1,27 @@ +[ + { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + } + +] \ No newline at end of file diff --git a/examples/3.0.0/license.json b/examples/3.0.0/license.json new file mode 100644 index 00000000..18becf4f --- /dev/null +++ b/examples/3.0.0/license.json @@ -0,0 +1,7 @@ +[ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + +] \ No newline at end of file diff --git a/examples/3.0.0/messageObject.json b/examples/3.0.0/messageObject.json new file mode 100644 index 00000000..9243d026 --- /dev/null +++ b/examples/3.0.0/messageObject.json @@ -0,0 +1,58 @@ +[ +{ + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [{ "name": "user" }, { "name": "signup" }, { "name": "register" }], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [{ "$ref": "#/components/messageTraits/commonHeaders" }], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] +} +] \ No newline at end of file diff --git a/examples/3.0.0/messageTrait.json b/examples/3.0.0/messageTrait.json new file mode 100644 index 00000000..5126ee4a --- /dev/null +++ b/examples/3.0.0/messageTrait.json @@ -0,0 +1,3 @@ +[ { + "contentType": "application/json" +} ] \ No newline at end of file diff --git a/examples/3.0.0/oauth2Flow.json b/examples/3.0.0/oauth2Flow.json new file mode 100644 index 00000000..0f8b4083 --- /dev/null +++ b/examples/3.0.0/oauth2Flow.json @@ -0,0 +1,8 @@ +[{ + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } +}] \ No newline at end of file diff --git a/examples/3.0.0/operation.json b/examples/3.0.0/operation.json new file mode 100644 index 00000000..bdddeb81 --- /dev/null +++ b/examples/3.0.0/operation.json @@ -0,0 +1,31 @@ +[{ + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "security": [ + { + "petstore_auth": ["write:pets", "read:pets"] + } + ], + "tags": [{ "name": "user" }, { "name": "signup" }, { "name": "register" }], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [{ "$ref": "#/components/operationTraits/kafka" }], + "messages": [{ "$ref": "/components/messages/userSignedUp" }], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [{ "$ref": "/components/messages/userSignedUpReply" }] + } +}] \ No newline at end of file diff --git a/examples/3.0.0/operationReplyAddress.json b/examples/3.0.0/operationReplyAddress.json new file mode 100644 index 00000000..53a7a78b --- /dev/null +++ b/examples/3.0.0/operationReplyAddress.json @@ -0,0 +1,4 @@ +[{ + "description": "Consumer inbox", + "location": "$message.header#/replyTo" +}] \ No newline at end of file diff --git a/examples/3.0.0/operationTrait.json b/examples/3.0.0/operationTrait.json new file mode 100644 index 00000000..98e8dbf5 --- /dev/null +++ b/examples/3.0.0/operationTrait.json @@ -0,0 +1,7 @@ +[{ + "bindings": { + "amqp": { + "ack": false + } + } +}] \ No newline at end of file diff --git a/examples/3.0.0/operations.json b/examples/3.0.0/operations.json new file mode 100644 index 00000000..a623a01a --- /dev/null +++ b/examples/3.0.0/operations.json @@ -0,0 +1,18 @@ +[{ + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [{ "name": "user" }, { "name": "signup" }, { "name": "register" }], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [{ "$ref": "#/components/operationTraits/kafka" }] + } +}] \ No newline at end of file diff --git a/examples/3.0.0/parameter.json b/examples/3.0.0/parameter.json new file mode 100644 index 00000000..45e25436 --- /dev/null +++ b/examples/3.0.0/parameter.json @@ -0,0 +1,9 @@ +[{ + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + } +}] \ No newline at end of file diff --git a/examples/3.0.0/parameters.json b/examples/3.0.0/parameters.json new file mode 100644 index 00000000..ad7bc889 --- /dev/null +++ b/examples/3.0.0/parameters.json @@ -0,0 +1,8 @@ +[{ + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user." + } + } +}] \ No newline at end of file diff --git a/examples/3.0.0/server.json b/examples/3.0.0/server.json new file mode 100644 index 00000000..3868a102 --- /dev/null +++ b/examples/3.0.0/server.json @@ -0,0 +1,14 @@ +[ + { + "host": "kafka.in.mycompany.com:9092", + "description": "Production Kafka broker.", + "protocol": "kafka", + "protocolVersion": "3.2" + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } +] diff --git a/examples/3.0.0/serverVariable.json b/examples/3.0.0/serverVariable.json new file mode 100644 index 00000000..467af35f --- /dev/null +++ b/examples/3.0.0/serverVariable.json @@ -0,0 +1,14 @@ +[ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": ["production", "staging"] + } + } + } +] diff --git a/examples/3.0.0/servers.json b/examples/3.0.0/servers.json new file mode 100644 index 00000000..be5bd9a1 --- /dev/null +++ b/examples/3.0.0/servers.json @@ -0,0 +1,38 @@ +[ { + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "description": "RabbitMQ broker for the staging environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ] + }, + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "description": "RabbitMQ broker for the production environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ] + } +} ] \ No newline at end of file diff --git a/examples/3.0.0/symmetricEncryption.json b/examples/3.0.0/symmetricEncryption.json new file mode 100644 index 00000000..cd4a9731 --- /dev/null +++ b/examples/3.0.0/symmetricEncryption.json @@ -0,0 +1,3 @@ +[{ + "type": "symmetricEncryption" +}] \ No newline at end of file diff --git a/examples/3.0.0/tag.json b/examples/3.0.0/tag.json new file mode 100644 index 00000000..4258baa6 --- /dev/null +++ b/examples/3.0.0/tag.json @@ -0,0 +1,4 @@ +[{ + "name": "user", + "description": "User-related messages" +}] \ No newline at end of file diff --git a/examples/3.0.0/userPassword.json b/examples/3.0.0/userPassword.json new file mode 100644 index 00000000..eb52bb8b --- /dev/null +++ b/examples/3.0.0/userPassword.json @@ -0,0 +1,5 @@ +[ + { + "type": "userPassword" + } +] \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 55ddd172..69ebc9b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@asyncapi/specs", - "version": "6.0.0-next-major-spec.11", + "version": "6.0.0-next-major-spec.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@asyncapi/specs", - "version": "6.0.0-next-major-spec.11", + "version": "6.0.0-next-major-spec.14", "license": "Apache-2.0", "dependencies": { "@types/json-schema": "^7.0.11" diff --git a/package.json b/package.json index 2813fd6e..37de273c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@asyncapi/specs", - "version": "6.0.0-next-major-spec.11", + "version": "6.0.0-next-major-spec.14", "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 d604e3b5..0afbfd05 100644 --- a/schemas/3.0.0-without-$id.json +++ b/schemas/3.0.0-without-$id.json @@ -30,7 +30,8 @@ "$ref": "#/definitions/servers" }, "defaultContentType": { - "type": "string" + "type": "string", + "description": "Default content type to use when encoding/decoding a message's payload." }, "channels": { "$ref": "#/definitions/channels" @@ -50,7 +51,7 @@ }, "info": { "type": "object", - "description": "General information about the API.", + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", "required": [ "version", "title" @@ -87,6 +88,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", "items": { "oneOf": [ { @@ -109,11 +111,37 @@ } ] } - } + }, + "examples": [ + { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + } + ] }, "contact": { "type": "object", - "description": "Contact information for the owners of the API.", + "description": "Contact information for the exposed API.", "additionalProperties": false, "properties": { "name": { @@ -135,7 +163,14 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "#/definitions/specificationExtension" } - } + }, + "examples": [ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + ] }, "license": { "type": "object", @@ -158,18 +193,31 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "#/definitions/specificationExtension" } - } + }, + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] }, "Reference": { "type": "object", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", "required": [ "$ref" ], "properties": { "$ref": { + "description": "The reference string.", "$ref": "#/definitions/ReferenceObject" } - } + }, + "examples": [ + { + "$ref": "#/components/schemas/Pet" + } + ] }, "ReferenceObject": { "type": "string", @@ -177,16 +225,19 @@ }, "tag": { "type": "object", + "description": "Allows adding metadata to a single tag.", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { - "type": "string" + "type": "string", + "description": "The name of the tag." }, "description": { - "type": "string" + "type": "string", + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation." }, "externalDocs": { "oneOf": [ @@ -203,21 +254,29 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "#/definitions/specificationExtension" } - } + }, + "examples": [ + { + "name": "user", + "description": "User-related messages" + } + ] }, "externalDocs": { "type": "object", "additionalProperties": false, - "description": "information about external documentation", + "description": "Allows referencing an external resource for extended documentation.", "required": [ "url" ], "properties": { "description": { - "type": "string" + "type": "string", + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation." }, "url": { "type": "string", + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", "format": "uri" } }, @@ -225,7 +284,13 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "#/definitions/specificationExtension" } - } + }, + "examples": [ + { + "description": "Find more info here", + "url": "https://example.com" + } + ] }, "servers": { "description": "An object representing multiple servers.", @@ -239,11 +304,51 @@ "$ref": "#/definitions/server" } ] - } + }, + "examples": [ + { + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "description": "RabbitMQ broker for the staging environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ] + }, + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "description": "RabbitMQ broker for the production environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ] + } + } + ] }, "server": { "type": "object", - "description": "An object representing a Server.", + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", "required": [ "host", "protocol" @@ -257,11 +362,11 @@ "properties": { "host": { "type": "string", - "description": "The server host name." + "description": "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." }, "pathname": { "type": "string", - "description": "The path to a resource in the host." + "description": "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." }, "title": { "type": "string", @@ -277,10 +382,11 @@ }, "protocol": { "type": "string", - "description": "The transfer protocol." + "description": "The protocol this server supports for connection." }, "protocolVersion": { - "type": "string" + "type": "string", + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." }, "variables": { "$ref": "#/definitions/serverVariables" @@ -313,9 +419,30 @@ ] }, "bindings": { - "$ref": "#/definitions/serverBindingsObject" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/serverBindingsObject" + } + ] } - } + }, + "examples": [ + { + "host": "kafka.in.mycompany.com:9092", + "description": "Production Kafka broker.", + "protocol": "kafka", + "protocolVersion": "3.2" + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } + ] }, "serverVariables": { "type": "object", @@ -342,24 +469,45 @@ "properties": { "enum": { "type": "array", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", "items": { "type": "string" }, "uniqueItems": true }, "default": { - "type": "string" + "type": "string", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied." }, "description": { - "type": "string" + "type": "string", + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." }, "examples": { "type": "array", + "description": "An array of examples of the server variable.", "items": { "type": "string" } } - } + }, + "examples": [ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] + } + } + } + ] }, "securityRequirements": { "description": "An array representing security requirements.", @@ -376,6 +524,7 @@ } }, "SecurityScheme": { + "description": "Defines a security scheme that can be used by the operations.", "oneOf": [ { "$ref": "#/definitions/userPassword" @@ -404,6 +553,11 @@ { "$ref": "#/definitions/SaslSecurityScheme" } + ], + "examples": [ + { + "type": "userPassword" + } ] }, "userPassword": { @@ -427,7 +581,12 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "userPassword" + } + ] }, "apiKey": { "type": "object", @@ -438,19 +597,22 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme", "enum": [ "apiKey" ] }, "in": { "type": "string", + "description": " The location of the API key.", "enum": [ "user", "password" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -458,7 +620,13 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "apiKey", + "in": "user" + } + ] }, "X509": { "type": "object", @@ -481,7 +649,12 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "X509" + } + ] }, "symmetricEncryption": { "type": "object", @@ -504,7 +677,12 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "symmetricEncryption" + } + ] }, "asymmetricEncryption": { "type": "object", @@ -514,12 +692,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "asymmetricEncryption" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -548,6 +728,7 @@ "properties": { "scheme": { "type": "string", + "description": "A short description for security scheme.", "enum": [ "bearer" ] @@ -561,13 +742,16 @@ ], "properties": { "scheme": { - "type": "string" + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." }, "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "http" ] @@ -589,21 +773,25 @@ "properties": { "scheme": { "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", "enum": [ "bearer" ] }, "bearerFormat": { - "type": "string" + "type": "string", + "description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." }, "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "http" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -623,15 +811,18 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "httpApiKey" ] }, "name": { - "type": "string" + "type": "string", + "description": "The name of the header, query or cookie parameter to be used." }, "in": { "type": "string", + "description": "The location of the API key", "enum": [ "header", "query", @@ -639,7 +830,8 @@ ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -647,10 +839,18 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } + ] }, "oauth2Flows": { "type": "object", + "description": "Allows configuration of the supported OAuth Flows.", "required": [ "type", "flows" @@ -658,17 +858,20 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "oauth2" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." }, "flows": { "type": "object", "properties": { "implicit": { + "description": "Configuration for the OAuth Implicit flow.", "allOf": [ { "$ref": "#/definitions/oauth2Flow" @@ -689,6 +892,7 @@ ] }, "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", "allOf": [ { "$ref": "#/definitions/oauth2Flow" @@ -709,6 +913,7 @@ ] }, "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", "allOf": [ { "$ref": "#/definitions/oauth2Flow" @@ -729,6 +934,7 @@ ] }, "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", "allOf": [ { "$ref": "#/definitions/oauth2Flow" @@ -761,21 +967,26 @@ }, "oauth2Flow": { "type": "object", + "description": "Configuration details for a supported OAuth Flow", "properties": { "authorizationUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." }, "tokenUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL." }, "refreshUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." }, "availableScopes": { - "$ref": "#/definitions/oauth2Scopes" + "$ref": "#/definitions/oauth2Scopes", + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." } }, "patternProperties": { @@ -783,7 +994,17 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] }, "oauth2Scopes": { "type": "object", @@ -800,20 +1021,23 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "openIdConnect" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." }, "openIdConnectUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." }, "scopes": { "type": "array", - "description": "List of the needed scope names.", + "description": "List of the needed scope names. An empty array means no scopes are needed.", "items": { "type": "string" } @@ -847,12 +1071,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme. Valid values", "enum": [ "plain" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -860,7 +1086,12 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] }, "SaslScramSecurityScheme": { "type": "object", @@ -870,13 +1101,15 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "scramSha256", "scramSha512" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -884,7 +1117,12 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] }, "SaslGssapiSecurityScheme": { "type": "object", @@ -894,12 +1132,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "gssapi" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -907,10 +1147,16 @@ "$ref": "#/definitions/specificationExtension" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] }, "serverBindingsObject": { "type": "object", + "description": "Map describing protocol-specific definitions for a server.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -1057,7 +1303,45 @@ }, "anypointmq": {}, "nats": {}, - "jms": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + } + } + ] + }, "sns": {}, "sqs": {}, "stomp": {}, @@ -1320,6 +1604,7 @@ ] }, "schema": { + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", "allOf": [ { "$ref": "#/definitions/json-schema-draft-07-schema" @@ -1402,7 +1687,8 @@ "$ref": "#/definitions/schema" }, "discriminator": { - "type": "string" + "type": "string", + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." }, "externalDocs": { "oneOf": [ @@ -1416,6 +1702,7 @@ }, "deprecated": { "type": "boolean", + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", "default": false } } @@ -1735,9 +2022,9 @@ } ] }, - "bindings-ibmmq-0.1.0-server": { - "title": "IBM MQ server bindings object", - "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "bindings-jms-0.0.1-server": { + "title": "Server Schema", + "description": "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -1745,31 +2032,106 @@ "$ref": "#/definitions/specificationExtension" } }, + "required": [ + "jmsConnectionFactory" + ], "properties": { - "groupId": { + "jmsConnectionFactory": { "type": "string", - "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + "description": "The classname of the ConnectionFactory implementation for the JMS Provider." }, - "ccdtQueueManagerName": { - "type": "string", - "default": "*", - "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + "properties": { + "type": "array", + "items": { + "$ref": "#/definitions/bindings-jms-0.0.1-server" + }, + "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." }, - "cipherSpec": { + "clientID": { "type": "string", - "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." - }, - "multiEndpointServer": { - "type": "boolean", - "default": false, - "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + "description": "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." }, - "heartBeatInterval": { - "type": "integer", - "minimum": 0, - "maximum": 999999, - "default": 300, - "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "definitions": { + "property": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of a property" + }, + "value": { + "type": [ + "string", + "boolean", + "number", + "null" + ], + "description": "The name of a property" + } + } + } + }, + "examples": [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1", + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-server": { + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, + "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." }, "bindingVersion": { "type": "string", @@ -1883,6 +2245,7 @@ }, "channels": { "type": "object", + "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", "additionalProperties": { "oneOf": [ { @@ -1892,10 +2255,23 @@ "$ref": "#/definitions/channel" } ] - } + }, + "examples": [ + { + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] }, "channel": { "type": "object", + "description": "Describes a shared communication channel.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -1938,6 +2314,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for logical grouping of channels.", "items": { "oneOf": [ { @@ -1961,9 +2338,62 @@ ] }, "bindings": { - "$ref": "#/definitions/channelBindingsObject" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/channelBindingsObject" + } + ] } - } + }, + "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" + } + } + ] }, "channelMessages": { "type": "object", @@ -1981,6 +2411,7 @@ }, "messageObject": { "type": "object", + "description": "Describes a message received on a given channel and operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -1989,7 +2420,8 @@ }, "properties": { "contentType": { - "type": "string" + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." }, "headers": { "$ref": "#/definitions/anySchema" @@ -2053,6 +2485,7 @@ }, "examples": { "type": "array", + "description": "List of examples.", "items": { "type": "object", "additionalProperties": false, @@ -2088,10 +2521,18 @@ } }, "bindings": { - "$ref": "#/definitions/messageBindingsObject" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] }, "traits": { "type": "array", + "description": "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", "items": { "oneOf": [ { @@ -2122,7 +2563,79 @@ ] } } - } + }, + "examples": [ + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + } + ] }, "anySchema": { "if": { @@ -2139,6 +2652,7 @@ "description": "An object representing either a schema or a multiFormatSchema based on the existence of the 'schema' property. If the property 'schema' is present, use the multi-format schema. Use the default AsyncAPI Schema otherwise." }, "multiFormatSchema": { + "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", "if": { "not": { "type": "object" @@ -2157,6 +2671,7 @@ }, "properties": { "schemaFormat": { + "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", "anyOf": [ { "type": "string" @@ -2185,7 +2700,9 @@ } ] }, - "schema": {} + "schema": { + "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." + } }, "allOf": [ { @@ -2959,6 +3476,7 @@ }, "correlationId": { "type": "object", + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", "required": [ "location" ], @@ -2978,10 +3496,17 @@ "description": "A runtime expression that specifies the location of the correlation ID", "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } - } + }, + "examples": [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ] }, "messageBindingsObject": { "type": "object", + "description": "Map describing protocol-specific definitions for a message.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -3220,7 +3745,45 @@ ] }, "nats": {}, - "jms": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-message" + } + } + ] + }, "sns": {}, "sqs": {}, "stomp": {}, @@ -3587,7 +4150,14 @@ }, "properties": { "headers": { - "$ref": "#/definitions/schema", + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." }, "bindingVersion": { @@ -3612,9 +4182,9 @@ } ] }, - "bindings-ibmmq-0.1.0-message": { - "title": "IBM MQ message bindings object", - "description": "This object contains information about the message representation in IBM MQ.", + "bindings-jms-0.0.1-message": { + "title": "Message Schema", + "description": "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -3623,54 +4193,138 @@ } }, "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "jms", - "binary" - ], - "default": "string", - "description": "The type of the message." - }, "headers": { - "type": "string", - "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." - }, - "description": { - "type": "string", - "description": "Provides additional information for application developers: describes the message type or format." - }, - "expiry": { - "type": "integer", - "minimum": 0, - "default": 0, - "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + "$ref": "#/definitions/schema", + "description": "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." }, "bindingVersion": { "type": "string", "enum": [ - "0.1.0" + "0.0.1" ], - "description": "The version of this binding." + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." } }, - "oneOf": [ - { - "properties": { - "type": { - "const": "binary" - } - } - }, + "examples": [ { - "properties": { - "type": { - "const": "jms" - } - }, - "not": { - "required": [ + "headers": { + "type": "object", + "required": [ + "JMSMessageID" + ], + "properties": { + "JMSMessageID": { + "type": [ + "string", + "null" + ], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": [ + "PERSISTENT", + "NON_PERSISTENT" + ], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": [ + "string", + "null" + ], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": [ + "string", + "null" + ], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "bindings-ibmmq-0.1.0-message": { + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { + "required": [ "headers" ] } @@ -3752,6 +4406,7 @@ }, "messageTrait": { "type": "object", + "description": "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -3760,7 +4415,8 @@ }, "properties": { "contentType": { - "type": "string" + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." }, "headers": { "$ref": "#/definitions/anySchema" @@ -3821,14 +4477,27 @@ }, "examples": { "type": "array", + "description": "List of examples.", "items": { "type": "object" } }, "bindings": { - "$ref": "#/definitions/messageBindingsObject" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/messageBindingsObject" + } + ] } - } + }, + "examples": [ + { + "contentType": "application/json" + } + ] }, "parameters": { "type": "object", @@ -3842,9 +4511,20 @@ } ] }, - "description": "JSON objects describing re-usable channel parameters." + "description": "JSON objects describing re-usable channel parameters.", + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user." + } + } + } + ] }, "parameter": { + "description": "Describes a parameter included in a channel address.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -3857,18 +4537,18 @@ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "enum": { - "description": "A list of allowed values for the parameter.", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", "type": "array", "items": { "type": "string" } }, "default": { - "description": "The default value to use for the parameter.", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", "type": "string" }, "examples": { - "description": "List of example values to use for the parameter.", + "description": "An array of examples of the parameter value.", "type": "array", "items": { "type": "string" @@ -3879,10 +4559,22 @@ "description": "A runtime expression that specifies the location of the parameter value", "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } - } + }, + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + } + } + ] }, "channelBindingsObject": { "type": "object", + "description": "Map describing protocol-specific definitions for a channel.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -4067,9 +4759,123 @@ ] }, "nats": {}, - "jms": {}, - "sns": {}, - "sqs": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-jms-0.0.1-channel" + } + } + ] + }, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + } + ] + }, "stomp": {}, "redis": {}, "ibmmq": { @@ -4212,11 +5018,25 @@ "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." }, "query": { - "$ref": "#/definitions/schema", + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." }, "headers": { - "$ref": "#/definitions/schema", + "oneOf": [ + { + "$ref": "#/definitions/schema" + }, + { + "$ref": "#/definitions/Reference" + } + ], "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." }, "bindingVersion": { @@ -4544,9 +5364,9 @@ } ] }, - "bindings-ibmmq-0.1.0-channel": { - "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.", + "bindings-jms-0.0.1-channel": { + "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": { @@ -4555,14 +5375,470 @@ } }, "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": [ - "topic", - "queue" + "queue", + "fifo-queue" ], - "default": "topic", - "description": "Defines the type of AsyncAPI channel." + "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" + } + ] + }, + "bindings-sns-0.1.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + "ordering": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + }, + "policy": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the topic." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "name" + ], + "definitions": { + "ordering": { + "type": "object", + "description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "type": { + "type": "string", + "description": "Defines the type of SNS Topic.", + "enum": [ + "standard", + "FIFO" + ] + }, + "contentBasedDeduplication": { + "type": "boolean", + "description": "True to turn on de-duplication of messages for a channel." + } + }, + "required": [ + "type" + ] + }, + "policy": { + "type": "object", + "description": "The security policy for the SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this topic", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-channel" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SNS permission being allowed or denied e.g. sns:Publish", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ] + }, + "bindings-sqs-0.2.0-channel": { + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "queue": { + "description": "A definition of the queue that will be used as the channel.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "deadLetterQueue": { + "description": "A definition of the queue that will be used for un-processable messages.", + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queue" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name", + "fifoQueue" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-channel" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ] + }, + "bindings-ibmmq-0.1.0-channel": { + "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": "#/definitions/specificationExtension" + } + }, + "properties": { + "destinationType": { + "type": "string", + "enum": [ + "topic", + "queue" + ], + "default": "topic", + "description": "Defines the type of AsyncAPI channel." }, "queue": { "type": "object", @@ -4849,6 +6125,7 @@ }, "operations": { "type": "object", + "description": "Holds a dictionary with all the operations this application MUST implement.", "additionalProperties": { "oneOf": [ { @@ -4858,10 +6135,45 @@ "$ref": "#/definitions/operation" } ] - } + }, + "examples": [ + { + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + } + ] }, "operation": { "type": "object", + "description": "Describes a specific operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -4886,6 +6198,7 @@ }, "messages": { "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", "items": { "$ref": "#/definitions/Reference" } @@ -4902,6 +6215,7 @@ }, "traits": { "type": "array", + "description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", "items": { "oneOf": [ { @@ -4930,6 +6244,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", "items": { "oneOf": [ { @@ -4953,12 +6268,78 @@ ] }, "bindings": { - "$ref": "#/definitions/operationBindingsObject" + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] } - } + }, + "examples": [ + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ], + "messages": [ + { + "$ref": "/components/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUpReply" + } + ] + } + } + ] }, "operationReply": { "type": "object", + "description": "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -4981,6 +6362,7 @@ }, "messages": { "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", "items": { "$ref": "#/definitions/Reference" } @@ -4989,6 +6371,7 @@ }, "operationReplyAddress": { "type": "object", + "description": "An object that specifies where an operation has to send the reply", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5008,10 +6391,17 @@ "type": "string", "description": "An optional description of the address. CommonMark is allowed." } - } + }, + "examples": [ + { + "description": "Consumer inbox", + "location": "$message.header#/replyTo" + } + ] }, "operationTrait": { "type": "object", + "description": "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5020,30 +6410,54 @@ }, "properties": { "title": { + "description": "A human-friendly title for the operation.", "$ref": "#/definitions/operation/properties/title" }, "summary": { + "description": "A short summary of what the operation is about.", "$ref": "#/definitions/operation/properties/summary" }, "description": { + "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", "$ref": "#/definitions/operation/properties/description" }, "security": { + "description": "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", "$ref": "#/definitions/operation/properties/security" }, "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", "$ref": "#/definitions/operation/properties/tags" }, "externalDocs": { + "description": "Additional external documentation for this operation.", "$ref": "#/definitions/operation/properties/externalDocs" }, "bindings": { - "$ref": "#/definitions/operation/properties/bindings" + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operationBindingsObject" + } + ] + } + }, + "examples": [ + { + "bindings": { + "amqp": { + "ack": false + } + } } - } + ] }, "operationBindingsObject": { "type": "object", + "description": "Map describing protocol-specific definitions for an operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5283,8 +6697,84 @@ ] }, "jms": {}, - "sns": {}, - "sqs": {}, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + } + } + ] + }, + "sqs": { + "properties": { + "bindingVersion": { + "enum": [ + "0.2.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + } + ] + }, "stomp": {}, "redis": {}, "ibmmq": {}, @@ -5661,25 +7151,327 @@ }, "examples": [ { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.1.0" + } + ] + }, + "bindings-nats-0.1.0-operation": { + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/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" + } + ] + }, + "bindings-sns-0.1.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "topic": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + "consumers": { + "type": "array", + "description": "The protocols that listen to this topic and their endpoints.", + "items": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + }, + "minItems": 1 + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "consumers" + ], + "definitions": { + "identifier": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "url": { + "type": "string", + "description": "The endpoint is a URL." + }, + "email": { + "type": "string", + "description": "The endpoint is an email address." + }, + "phone": { + "type": "string", + "description": "The endpoint is a phone number." + }, + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + "consumer": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "protocol": { + "description": "The protocol that this endpoint receives messages by.", + "type": "string", + "enum": [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + "endpoint": { + "description": "The endpoint messages are delivered to.", + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + }, + "filterPolicy": { + "type": "object", + "description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "filterPolicyScope": { + "type": "string", + "description": "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + "enum": [ + "MessageAttributes", + "MessageBody" + ], + "default": "MessageAttributes" + }, + "rawMessageDelivery": { + "type": "boolean", + "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation" + }, + "deliveryPolicy": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + "displayName": { + "type": "string", + "description": "The display name to use with an SNS subscription" + } + }, + "required": [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + "deliveryPolicy": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "minDelayTarget": { + "type": "integer", + "description": "The minimum delay for a retry in seconds." + }, + "maxDelayTarget": { + "type": "integer", + "description": "The maximum delay for a retry in seconds." + }, + "numRetries": { + "type": "integer", + "description": "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + "numNoDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with no delay)." + }, + "numMinDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with delay)." + }, + "numMaxDelayRetries": { + "type": "integer", + "description": "The number of post-backoff phase retries, with the maximum delay between retries." + }, + "backoffFunction": { + "type": "string", + "description": "The algorithm for backoff between retries.", + "enum": [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + "maxReceivesPerSecond": { + "type": "integer", + "description": "The maximum number of deliveries per second, per subscription." + } + } + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sns-0.1.0-operation", + "description": "The SQS queue to use as a dead letter queue (DLQ)." + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + } + }, + "examples": [ + { + "topic": { + "name": "someTopic" }, - "bindingVersion": "0.1.0" + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicy": { + "store": [ + "asyncapi_corp" + ], + "event": [ + { + "anything-but": "order_cancelled" + } + ], + "customer_interests": [ + "rugby", + "football", + "baseball" + ] + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] } ] }, - "bindings-nats-0.1.0-operation": { - "title": "NATS operation bindings object", - "description": "This object contains information about the operation representation in NATS.", + "bindings-sqs-0.2.0-operation": { + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SQS.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -5688,23 +7480,254 @@ } }, "properties": { - "queue": { - "type": "string", - "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", - "maxLength": 255 + "queues": { + "type": "array", + "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } }, "bindingVersion": { "type": "string", "enum": [ - "0.1.0" + "0.1.0", + "0.2.0" ], - "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queues" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "$ref": { + "type": "string", + "description": "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + }, + "policy": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "#/definitions/bindings-sqs-0.2.0-operation" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "#/definitions/specificationExtension" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] } }, "examples": [ { - "queue": "MyCustomQueue", - "bindingVersion": "0.1.0" + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] } ] }, @@ -5926,7 +7949,7 @@ }, "components": { "type": "object", - "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5936,6 +7959,7 @@ "properties": { "schemas": { "type": "object", + "description": "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -5951,6 +7975,7 @@ }, "servers": { "type": "object", + "description": "An object to hold reusable Server Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -5966,6 +7991,7 @@ }, "channels": { "type": "object", + "description": "An object to hold reusable Channel Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -5981,6 +8007,7 @@ }, "serverVariables": { "type": "object", + "description": "An object to hold reusable Server Variable Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -5994,8 +8021,24 @@ } } }, + "operations": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "#/definitions/Reference" + }, + { + "$ref": "#/definitions/operation" + } + ] + } + } + }, "messages": { "type": "object", + "description": "An object to hold reusable Message Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6011,6 +8054,7 @@ }, "securitySchemes": { "type": "object", + "description": "An object to hold reusable Security Scheme Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6026,6 +8070,7 @@ }, "parameters": { "type": "object", + "description": "An object to hold reusable Parameter Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6041,6 +8086,7 @@ }, "correlationIds": { "type": "object", + "description": "An object to hold reusable Correlation ID Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6056,6 +8102,7 @@ }, "operationTraits": { "type": "object", + "description": "An object to hold reusable Operation Trait Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6071,6 +8118,7 @@ }, "messageTraits": { "type": "object", + "description": "An object to hold reusable Message Trait Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6086,6 +8134,7 @@ }, "replies": { "type": "object", + "description": "An object to hold reusable Operation Reply Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6101,6 +8150,7 @@ }, "replyAddresses": { "type": "object", + "description": "An object to hold reusable Operation Reply Address Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6116,6 +8166,7 @@ }, "serverBindings": { "type": "object", + "description": "An object to hold reusable Server Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6131,6 +8182,7 @@ }, "channelBindings": { "type": "object", + "description": "An object to hold reusable Channel Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6146,6 +8198,7 @@ }, "operationBindings": { "type": "object", + "description": "An object to hold reusable Operation Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6161,6 +8214,7 @@ }, "messageBindings": { "type": "object", + "description": "An object to hold reusable Message Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6176,6 +8230,7 @@ }, "tags": { "type": "object", + "description": "An object to hold reusable Tag Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6191,6 +8246,7 @@ }, "externalDocs": { "type": "object", + "description": "An object to hold reusable External Documentation Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6204,7 +8260,142 @@ } } } - } + }, + "examples": [ + { + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "description": "RabbitMQ broker", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": [ + "5671", + "5672" + ], + "default": "5672" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } + } + ] } }, "description": "!!Auto generated!! \n Do not manually edit. " diff --git a/schemas/3.0.0.json b/schemas/3.0.0.json index eb8dc85a..fbb5ab8f 100644 --- a/schemas/3.0.0.json +++ b/schemas/3.0.0.json @@ -31,7 +31,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/servers.json" }, "defaultContentType": { - "type": "string" + "type": "string", + "description": "Default content type to use when encoding/decoding a message's payload." }, "channels": { "$ref": "http://asyncapi.com/definitions/3.0.0/channels.json" @@ -53,7 +54,7 @@ "http://asyncapi.com/definitions/3.0.0/info.json": { "$id": "http://asyncapi.com/definitions/3.0.0/info.json", "type": "object", - "description": "General information about the API.", + "description": "The object provides metadata about the API. The metadata can be used by the clients if needed.", "required": [ "version", "title" @@ -90,6 +91,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for application API documentation control. Tags can be used for logical grouping of applications.", "items": { "oneOf": [ { @@ -112,12 +114,38 @@ } ] } - } + }, + "examples": [ + { + "title": "AsyncAPI Sample App", + "version": "1.0.1", + "description": "This is a sample app.", + "termsOfService": "https://asyncapi.org/terms/", + "contact": { + "name": "API Support", + "url": "https://www.asyncapi.org/support", + "email": "support@asyncapi.org" + }, + "license": { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + }, + "externalDocs": { + "description": "Find more info here", + "url": "https://www.asyncapi.org" + }, + "tags": [ + { + "name": "e-commerce" + } + ] + } + ] }, "http://asyncapi.com/definitions/3.0.0/contact.json": { "$id": "http://asyncapi.com/definitions/3.0.0/contact.json", "type": "object", - "description": "Contact information for the owners of the API.", + "description": "Contact information for the exposed API.", "additionalProperties": false, "properties": { "name": { @@ -139,7 +167,14 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } - } + }, + "examples": [ + { + "name": "API Support", + "url": "https://www.example.com/support", + "email": "support@example.com" + } + ] }, "http://asyncapi.com/definitions/3.0.0/license.json": { "$id": "http://asyncapi.com/definitions/3.0.0/license.json", @@ -163,19 +198,32 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } - } + }, + "examples": [ + { + "name": "Apache 2.0", + "url": "https://www.apache.org/licenses/LICENSE-2.0.html" + } + ] }, "http://asyncapi.com/definitions/3.0.0/Reference.json": { "$id": "http://asyncapi.com/definitions/3.0.0/Reference.json", "type": "object", + "description": "A simple object to allow referencing other components in the specification, internally and externally.", "required": [ "$ref" ], "properties": { "$ref": { + "description": "The reference string.", "$ref": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json" } - } + }, + "examples": [ + { + "$ref": "#/components/schemas/Pet" + } + ] }, "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/ReferenceObject.json", @@ -185,16 +233,19 @@ "http://asyncapi.com/definitions/3.0.0/tag.json": { "$id": "http://asyncapi.com/definitions/3.0.0/tag.json", "type": "object", + "description": "Allows adding metadata to a single tag.", "additionalProperties": false, "required": [ "name" ], "properties": { "name": { - "type": "string" + "type": "string", + "description": "The name of the tag." }, "description": { - "type": "string" + "type": "string", + "description": "A short description for the tag. CommonMark syntax can be used for rich text representation." }, "externalDocs": { "oneOf": [ @@ -211,22 +262,30 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } - } + }, + "examples": [ + { + "name": "user", + "description": "User-related messages" + } + ] }, "http://asyncapi.com/definitions/3.0.0/externalDocs.json": { "$id": "http://asyncapi.com/definitions/3.0.0/externalDocs.json", "type": "object", "additionalProperties": false, - "description": "information about external documentation", + "description": "Allows referencing an external resource for extended documentation.", "required": [ "url" ], "properties": { "description": { - "type": "string" + "type": "string", + "description": "A short description of the target documentation. CommonMark syntax can be used for rich text representation." }, "url": { "type": "string", + "description": "The URL for the target documentation. This MUST be in the form of an absolute URL.", "format": "uri" } }, @@ -234,7 +293,13 @@ "^x-[\\w\\d\\.\\x2d_]+$": { "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } - } + }, + "examples": [ + { + "description": "Find more info here", + "url": "https://example.com" + } + ] }, "http://asyncapi.com/definitions/3.0.0/servers.json": { "$id": "http://asyncapi.com/definitions/3.0.0/servers.json", @@ -249,12 +314,52 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/server.json" } ] - } + }, + "examples": [ + { + "development": { + "host": "localhost:5672", + "description": "Development AMQP broker.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:development", + "description": "This environment is meant for developers to run their own tests." + } + ] + }, + "staging": { + "host": "rabbitmq-staging.in.mycompany.com:5672", + "description": "RabbitMQ broker for the staging environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:staging", + "description": "This environment is a replica of the production environment." + } + ] + }, + "production": { + "host": "rabbitmq.in.mycompany.com:5672", + "description": "RabbitMQ broker for the production environment.", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "tags": [ + { + "name": "env:production", + "description": "This environment is the live environment available for final users." + } + ] + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/server.json": { "$id": "http://asyncapi.com/definitions/3.0.0/server.json", "type": "object", - "description": "An object representing a Server.", + "description": "An object representing a message broker, a server or any other kind of computer program capable of sending and/or receiving data.", "required": [ "host", "protocol" @@ -268,11 +373,11 @@ "properties": { "host": { "type": "string", - "description": "The server host name." + "description": "The server host name. It MAY include the port. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." }, "pathname": { "type": "string", - "description": "The path to a resource in the host." + "description": "The path to a resource in the host. This field supports Server Variables. Variable substitutions will be made when a variable is named in {braces}." }, "title": { "type": "string", @@ -288,10 +393,11 @@ }, "protocol": { "type": "string", - "description": "The transfer protocol." + "description": "The protocol this server supports for connection." }, "protocolVersion": { - "type": "string" + "type": "string", + "description": "An optional string describing the server. CommonMark syntax MAY be used for rich text representation." }, "variables": { "$ref": "http://asyncapi.com/definitions/3.0.0/serverVariables.json" @@ -324,9 +430,30 @@ ] }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json" + } + ] } - } + }, + "examples": [ + { + "host": "kafka.in.mycompany.com:9092", + "description": "Production Kafka broker.", + "protocol": "kafka", + "protocolVersion": "3.2" + }, + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/production", + "protocol": "amqp", + "description": "Production RabbitMQ broker (uses the `production` vhost)." + } + ] }, "http://asyncapi.com/definitions/3.0.0/serverVariables.json": { "$id": "http://asyncapi.com/definitions/3.0.0/serverVariables.json", @@ -355,24 +482,45 @@ "properties": { "enum": { "type": "array", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", "items": { "type": "string" }, "uniqueItems": true }, "default": { - "type": "string" + "type": "string", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied." }, "description": { - "type": "string" + "type": "string", + "description": "An optional description for the server variable. CommonMark syntax MAY be used for rich text representation." }, "examples": { "type": "array", + "description": "An array of examples of the server variable.", "items": { "type": "string" } } - } + }, + "examples": [ + { + "host": "rabbitmq.in.mycompany.com:5672", + "pathname": "/{env}", + "protocol": "amqp", + "description": "RabbitMQ broker. Use the `env` variable to point to either `production` or `staging`.", + "variables": { + "env": { + "description": "Environment to connect to. It can be either `production` or `staging`.", + "enum": [ + "production", + "staging" + ] + } + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/securityRequirements.json": { "$id": "http://asyncapi.com/definitions/3.0.0/securityRequirements.json", @@ -391,6 +539,7 @@ }, "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json": { "$id": "http://asyncapi.com/definitions/3.0.0/SecurityScheme.json", + "description": "Defines a security scheme that can be used by the operations.", "oneOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/userPassword.json" @@ -419,6 +568,11 @@ { "$ref": "http://asyncapi.com/definitions/3.0.0/SaslSecurityScheme.json" } + ], + "examples": [ + { + "type": "userPassword" + } ] }, "http://asyncapi.com/definitions/3.0.0/userPassword.json": { @@ -443,7 +597,12 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "userPassword" + } + ] }, "http://asyncapi.com/definitions/3.0.0/apiKey.json": { "$id": "http://asyncapi.com/definitions/3.0.0/apiKey.json", @@ -455,19 +614,22 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme", "enum": [ "apiKey" ] }, "in": { "type": "string", + "description": " The location of the API key.", "enum": [ "user", "password" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -475,7 +637,13 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "apiKey", + "in": "user" + } + ] }, "http://asyncapi.com/definitions/3.0.0/X509.json": { "$id": "http://asyncapi.com/definitions/3.0.0/X509.json", @@ -499,7 +667,12 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "X509" + } + ] }, "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json": { "$id": "http://asyncapi.com/definitions/3.0.0/symmetricEncryption.json", @@ -523,7 +696,12 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "symmetricEncryption" + } + ] }, "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json": { "$id": "http://asyncapi.com/definitions/3.0.0/asymmetricEncryption.json", @@ -534,12 +712,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "asymmetricEncryption" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -570,6 +750,7 @@ "properties": { "scheme": { "type": "string", + "description": "A short description for security scheme.", "enum": [ "bearer" ] @@ -583,13 +764,16 @@ ], "properties": { "scheme": { - "type": "string" + "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235." }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." }, "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "http" ] @@ -612,21 +796,25 @@ "properties": { "scheme": { "type": "string", + "description": "The name of the HTTP Authorization scheme to be used in the Authorization header as defined in RFC7235.", "enum": [ "bearer" ] }, "bearerFormat": { - "type": "string" + "type": "string", + "description": "A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes." }, "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "http" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -647,15 +835,18 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "httpApiKey" ] }, "name": { - "type": "string" + "type": "string", + "description": "The name of the header, query or cookie parameter to be used." }, "in": { "type": "string", + "description": "The location of the API key", "enum": [ "header", "query", @@ -663,7 +854,8 @@ ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." } }, "patternProperties": { @@ -671,11 +863,19 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "httpApiKey", + "name": "api_key", + "in": "header" + } + ] }, "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json": { "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flows.json", "type": "object", + "description": "Allows configuration of the supported OAuth Flows.", "required": [ "type", "flows" @@ -683,17 +883,20 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "oauth2" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." }, "flows": { "type": "object", "properties": { "implicit": { + "description": "Configuration for the OAuth Implicit flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -714,6 +917,7 @@ ] }, "password": { + "description": "Configuration for the OAuth Resource Owner Protected Credentials flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -734,6 +938,7 @@ ] }, "clientCredentials": { + "description": "Configuration for the OAuth Client Credentials flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -754,6 +959,7 @@ ] }, "authorizationCode": { + "description": "Configuration for the OAuth Authorization Code flow.", "allOf": [ { "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json" @@ -787,21 +993,26 @@ "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json": { "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Flow.json", "type": "object", + "description": "Configuration details for a supported OAuth Flow", "properties": { "authorizationUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The authorization URL to be used for this flow. This MUST be in the form of an absolute URL." }, "tokenUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The token URL to be used for this flow. This MUST be in the form of an absolute URL." }, "refreshUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "The URL to be used for obtaining refresh tokens. This MUST be in the form of an absolute URL." }, "availableScopes": { - "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json" + "$ref": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", + "description": "The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it." } }, "patternProperties": { @@ -809,7 +1020,17 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "authorizationUrl": "https://example.com/api/oauth/dialog", + "tokenUrl": "https://example.com/api/oauth/token", + "availableScopes": { + "write:pets": "modify pets in your account", + "read:pets": "read your pets" + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json": { "$id": "http://asyncapi.com/definitions/3.0.0/oauth2Scopes.json", @@ -828,20 +1049,23 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "openIdConnect" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme. CommonMark syntax MAY be used for rich text representation." }, "openIdConnectUrl": { "type": "string", - "format": "uri" + "format": "uri", + "description": "OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of an absolute URL." }, "scopes": { "type": "array", - "description": "List of the needed scope names.", + "description": "List of the needed scope names. An empty array means no scopes are needed.", "items": { "type": "string" } @@ -877,12 +1101,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme. Valid values", "enum": [ "plain" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -890,7 +1116,12 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] }, "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json": { "$id": "http://asyncapi.com/definitions/3.0.0/SaslScramSecurityScheme.json", @@ -901,13 +1132,15 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "scramSha256", "scramSha512" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -915,7 +1148,12 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] }, "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json": { "$id": "http://asyncapi.com/definitions/3.0.0/SaslGssapiSecurityScheme.json", @@ -926,12 +1164,14 @@ "properties": { "type": { "type": "string", + "description": "The type of the security scheme.", "enum": [ "gssapi" ] }, "description": { - "type": "string" + "type": "string", + "description": "A short description for security scheme." } }, "patternProperties": { @@ -939,11 +1179,17 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, - "additionalProperties": false + "additionalProperties": false, + "examples": [ + { + "type": "scramSha512" + } + ] }, "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/serverBindingsObject.json", "type": "object", + "description": "Map describing protocol-specific definitions for a server.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -1090,7 +1336,45 @@ }, "anypointmq": {}, "nats": {}, - "jms": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json" + } + } + ] + }, "sns": {}, "sqs": {}, "stomp": {}, @@ -1356,6 +1640,7 @@ }, "http://asyncapi.com/definitions/3.0.0/schema.json": { "$id": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is a superset of the JSON Schema Specification Draft 07. The empty schema (which allows any instance to validate) MAY be represented by the boolean value true and a schema which allows no instance to validate MAY be represented by the boolean value false.", "allOf": [ { "$ref": "http://json-schema.org/draft-07/schema#" @@ -1438,7 +1723,8 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" }, "discriminator": { - "type": "string" + "type": "string", + "description": "Adds support for polymorphism. The discriminator is the schema property name that is used to differentiate between other schema that inherit this schema. The property name used MUST be defined at this schema and it MUST be in the required property list. When used, the value MUST be the name of this schema or any schema that inherits it. See Composition and Inheritance for more details." }, "externalDocs": { "oneOf": [ @@ -1452,6 +1738,7 @@ }, "deprecated": { "type": "boolean", + "description": "Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is false.", "default": false } } @@ -1774,10 +2061,10 @@ } ] }, - "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json": { - "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", - "title": "IBM MQ server bindings object", - "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "http://asyncapi.com/bindings/jms/0.0.1/server.json": { + "$id": "http://asyncapi.com/bindings/jms/0.0.1/server.json", + "title": "Server Schema", + "description": "This object contains configuration for describing a JMS broker as an AsyncAPI server. This objects only contains configuration that can not be provided in the AsyncAPI standard server object.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -1785,30 +2072,106 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" } }, + "required": [ + "jmsConnectionFactory" + ], "properties": { - "groupId": { + "jmsConnectionFactory": { "type": "string", - "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + "description": "The classname of the ConnectionFactory implementation for the JMS Provider." }, - "ccdtQueueManagerName": { - "type": "string", - "default": "*", - "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + "properties": { + "type": "array", + "items": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/server.json#/definitions/property" + }, + "description": "Additional properties to set on the JMS ConnectionFactory implementation for the JMS Provider." }, - "cipherSpec": { + "clientID": { "type": "string", - "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." - }, - "multiEndpointServer": { - "type": "boolean", - "default": false, - "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + "description": "A client identifier for applications that use this JMS connection factory. If the Client ID Policy is set to 'Restricted' (the default), then configuring a Client ID on the ConnectionFactory prevents more than one JMS client from using a connection from this factory." }, - "heartBeatInterval": { - "type": "integer", - "minimum": 0, - "maximum": 999999, - "default": 300, + "bindingVersion": { + "type": "string", + "enum": [ + "0.0.1" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + } + }, + "definitions": { + "property": { + "type": "object", + "required": [ + "name", + "value" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of a property" + }, + "value": { + "type": [ + "string", + "boolean", + "number", + "null" + ], + "description": "The name of a property" + } + } + } + }, + "examples": [ + { + "jmsConnectionFactory": "org.apache.activemq.ActiveMQConnectionFactory", + "properties": [ + { + "name": "disableTimeStampsByDefault", + "value": false + } + ], + "clientID": "my-application-1", + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/server.json", + "title": "IBM MQ server bindings object", + "description": "This object contains server connection information about the IBM MQ server, referred to as an IBM MQ queue manager. This object contains additional connectivity information not possible to represent within the core AsyncAPI specification.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "groupId": { + "type": "string", + "description": "Defines a logical group of IBM MQ server objects. This is necessary to specify multi-endpoint configurations used in high availability deployments. If omitted, the server object is not part of a group." + }, + "ccdtQueueManagerName": { + "type": "string", + "default": "*", + "description": "The name of the IBM MQ queue manager to bind to in the CCDT file." + }, + "cipherSpec": { + "type": "string", + "description": "The recommended cipher specification used to establish a TLS connection between the client and the IBM MQ queue manager. More information on SSL/TLS cipher specifications supported by IBM MQ can be found on this page in the IBM MQ Knowledge Center." + }, + "multiEndpointServer": { + "type": "boolean", + "default": false, + "description": "If 'multiEndpointServer' is 'true' then multiple connections can be workload balanced and applications should not make assumptions as to where messages are processed. Where message ordering, or affinity to specific message resources is necessary, a single endpoint ('multiEndpointServer' = 'false') may be required." + }, + "heartBeatInterval": { + "type": "integer", + "minimum": 0, + "maximum": 999999, + "default": 300, "description": "The recommended value (in seconds) for the heartbeat sent to the queue manager during periods of inactivity. A value of zero means that no heart beats are sent. A value of 1 means that the client will use the value defined by the queue manager. More information on heart beat interval can be found on this page in the IBM MQ Knowledge Center." }, "bindingVersion": { @@ -1927,6 +2290,7 @@ "http://asyncapi.com/definitions/3.0.0/channels.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channels.json", "type": "object", + "description": "An object containing all the Channel Object definitions the Application MUST use during runtime.", "additionalProperties": { "oneOf": [ { @@ -1936,11 +2300,24 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/channel.json" } ] - } + }, + "examples": [ + { + "userSignedUp": { + "address": "user.signedup", + "messages": { + "userSignedUp": { + "$ref": "#/components/messages/userSignedUp" + } + } + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/channel.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channel.json", "type": "object", + "description": "Describes a shared communication channel.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -1983,6 +2360,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for logical grouping of channels.", "items": { "oneOf": [ { @@ -2006,9 +2384,62 @@ ] }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json" + } + ] } - } + }, + "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.0.0/channelMessages.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channelMessages.json", @@ -2028,6 +2459,7 @@ "http://asyncapi.com/definitions/3.0.0/messageObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/messageObject.json", "type": "object", + "description": "Describes a message received on a given channel and operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -2036,7 +2468,8 @@ }, "properties": { "contentType": { - "type": "string" + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." }, "headers": { "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" @@ -2100,6 +2533,7 @@ }, "examples": { "type": "array", + "description": "List of examples.", "items": { "type": "object", "additionalProperties": false, @@ -2135,10 +2569,18 @@ } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] }, "traits": { "type": "array", + "description": "A list of traits to apply to the message object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Message Object.", "items": { "oneOf": [ { @@ -2169,7 +2611,79 @@ ] } } - } + }, + "examples": [ + { + "messageId": "userSignup", + "name": "UserSignup", + "title": "User signup", + "summary": "Action to sign a user up.", + "description": "A longer description", + "contentType": "application/json", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "headers": { + "type": "object", + "properties": { + "correlationId": { + "description": "Correlation ID set by application", + "type": "string" + }, + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + }, + "correlationId": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + }, + "traits": [ + { + "$ref": "#/components/messageTraits/commonHeaders" + } + ], + "examples": [ + { + "name": "SimpleSignup", + "summary": "A simple UserSignup example message", + "headers": { + "correlationId": "my-correlation-id", + "applicationInstanceId": "myInstanceId" + }, + "payload": { + "user": { + "someUserKey": "someUserValue" + }, + "signup": { + "someSignupKey": "someSignupValue" + } + } + } + ] + } + ] }, "http://asyncapi.com/definitions/3.0.0/anySchema.json": { "$id": "http://asyncapi.com/definitions/3.0.0/anySchema.json", @@ -2188,6 +2702,7 @@ }, "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json": { "$id": "http://asyncapi.com/definitions/3.0.0/multiFormatSchema.json", + "description": "The Multi Format Schema Object represents a schema definition. It differs from the Schema Object in that it supports multiple schema formats or languages (e.g., JSON Schema, Avro, etc.).", "if": { "not": { "type": "object" @@ -2206,6 +2721,7 @@ }, "properties": { "schemaFormat": { + "description": "A string containing the name of the schema format that is used to define the information. If schemaFormat is missing, it MUST default to application/vnd.aai.asyncapi+json;version={{asyncapi}} where {{asyncapi}} matches the AsyncAPI Version String. In such a case, this would make the Multi Format Schema Object equivalent to the Schema Object. When using Reference Object within the schema, the schemaFormat of the resource being referenced MUST match the schemaFormat of the schema that contains the initial reference. For example, if you reference Avro schema, then schemaFormat of referencing resource and the resource being reference MUST match.", "anyOf": [ { "type": "string" @@ -2234,7 +2750,9 @@ } ] }, - "schema": {} + "schema": { + "description": "Definition of the message payload. It can be of any type but defaults to Schema Object. It MUST match the schema format defined in schemaFormat, including the encoding type. E.g., Avro should be inlined as either a YAML or JSON object instead of as a string to be parsed as YAML or JSON. Non-JSON-based schemas (e.g., Protobuf or XSD) MUST be inlined as a string." + } }, "allOf": [ { @@ -3011,6 +3529,7 @@ "http://asyncapi.com/definitions/3.0.0/correlationId.json": { "$id": "http://asyncapi.com/definitions/3.0.0/correlationId.json", "type": "object", + "description": "An object that specifies an identifier at design time that can used for message tracing and correlation.", "required": [ "location" ], @@ -3030,11 +3549,18 @@ "description": "A runtime expression that specifies the location of the correlation ID", "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } - } + }, + "examples": [ + { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + ] }, "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json", "type": "object", + "description": "Map describing protocol-specific definitions for a message.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -3273,7 +3799,45 @@ ] }, "nats": {}, - "jms": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.0.1" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/jms/0.0.1/message.json" + } + } + ] + }, "sns": {}, "sqs": {}, "stomp": {}, @@ -3647,7 +4211,14 @@ }, "properties": { "headers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], "description": "A Schema object containing the definitions for Anypoint MQ-specific headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of Anypoint MQ protocol headers are 'messageId' and 'messageGroupId'." }, "bindingVersion": { @@ -3672,10 +4243,10 @@ } ] }, - "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json": { - "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", - "title": "IBM MQ message bindings object", - "description": "This object contains information about the message representation in IBM MQ.", + "http://asyncapi.com/bindings/jms/0.0.1/message.json": { + "$id": "http://asyncapi.com/bindings/jms/0.0.1/message.json", + "title": "Message Schema", + "description": "This object contains configuration for describing a JMS message as an AsyncAPI message. This objects only contains configuration that can not be provided in the AsyncAPI standard message object.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -3684,53 +4255,138 @@ } }, "properties": { - "type": { - "type": "string", - "enum": [ - "string", - "jms", - "binary" - ], - "default": "string", - "description": "The type of the message." - }, "headers": { - "type": "string", - "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." - }, - "description": { - "type": "string", - "description": "Provides additional information for application developers: describes the message type or format." - }, - "expiry": { - "type": "integer", - "minimum": 0, - "default": 0, - "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "description": "A Schema object containing the definitions for JMS headers (protocol headers). This schema MUST be of type 'object' and have a 'properties' key. Examples of JMS protocol headers are 'JMSMessageID', 'JMSTimestamp', and 'JMSCorrelationID'." }, "bindingVersion": { "type": "string", "enum": [ - "0.1.0" + "0.0.1" ], - "description": "The version of this binding." + "description": "The version of this binding. If omitted, 'latest' MUST be assumed." } }, - "oneOf": [ - { - "properties": { - "type": { - "const": "binary" - } - } - }, + "examples": [ { - "properties": { - "type": { - "const": "jms" - } - }, - "not": { + "headers": { + "type": "object", + "required": [ + "JMSMessageID" + ], + "properties": { + "JMSMessageID": { + "type": [ + "string", + "null" + ], + "description": "A unique message identifier. This may be set by your JMS Provider on your behalf." + }, + "JMSTimestamp": { + "type": "integer", + "description": "The time the message was sent. This may be set by your JMS Provider on your behalf. The time the message was sent. The value of the timestamp is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC." + }, + "JMSDeliveryMode": { + "type": "string", + "enum": [ + "PERSISTENT", + "NON_PERSISTENT" + ], + "default": "PERSISTENT", + "description": "Denotes the delivery mode for the message. This may be set by your JMS Provider on your behalf." + }, + "JMSPriority": { + "type": "integer", + "default": 4, + "description": "The priority of the message. This may be set by your JMS Provider on your behalf." + }, + "JMSExpires": { + "type": "integer", + "description": "The time at which the message expires. This may be set by your JMS Provider on your behalf. A value of zero means that the message does not expire. Any non-zero value is the amount of time, measured in milliseconds, that has elapsed since midnight, January 1, 1970, UTC, at which the message will expire." + }, + "JMSType": { + "type": [ + "string", + "null" + ], + "description": "The type of message. Some JMS providers use a message repository that contains the definitions of messages sent by applications. The 'JMSType' header field may reference a message's definition in the provider's repository. The JMS API does not define a standard message definition repository, nor does it define a naming policy for the definitions it contains. Some messaging systems require that a message type definition for each application message be created and that each message specify its type. In order to work with such JMS providers, JMS clients should assign a value to 'JMSType', whether the application makes use of it or not. This ensures that the field is properly set for those providers that require it." + }, + "JMSCorrelationID": { + "type": [ + "string", + "null" + ], + "description": "The correlation identifier of the message. A client can use the 'JMSCorrelationID' header field to link one message with another. A typical use is to link a response message with its request message. Since each message sent by a JMS provider is assigned a message ID value, it is convenient to link messages via message ID, such message ID values must start with the 'ID:' prefix. Conversely, application-specified values must not start with the 'ID:' prefix; this is reserved for provider-generated message ID values." + }, + "JMSReplyTo": { + "type": "string", + "description": "The queue or topic that the message sender expects replies to." + } + } + }, + "bindingVersion": "0.0.1" + } + ] + }, + "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json": { + "$id": "http://asyncapi.com/bindings/ibmmq/0.1.0/message.json", + "title": "IBM MQ message bindings object", + "description": "This object contains information about the message representation in IBM MQ.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "type": { + "type": "string", + "enum": [ + "string", + "jms", + "binary" + ], + "default": "string", + "description": "The type of the message." + }, + "headers": { + "type": "string", + "description": "Defines the IBM MQ message headers to include with this message. More than one header can be specified as a comma separated list. Supporting information on IBM MQ message formats can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-format-mqchar8) in the IBM MQ Knowledge Center." + }, + "description": { + "type": "string", + "description": "Provides additional information for application developers: describes the message type or format." + }, + "expiry": { + "type": "integer", + "minimum": 0, + "default": 0, + "description": "The recommended setting the client should use for the TTL (Time-To-Live) of the message. This is a period of time expressed in milliseconds and set by the application that puts the message. 'expiry' values are API dependant e.g., MQI and JMS use different units of time and default values for 'unlimited'. General information on IBM MQ message expiry can be found on this [page](https://www.ibm.com/docs/en/ibm-mq/9.2?topic=mqmd-expiry-mqlong) in the IBM MQ Knowledge Center." + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0" + ], + "description": "The version of this binding." + } + }, + "oneOf": [ + { + "properties": { + "type": { + "const": "binary" + } + } + }, + { + "properties": { + "type": { + "const": "jms" + } + }, + "not": { "required": [ "headers" ] @@ -3815,6 +4471,7 @@ "http://asyncapi.com/definitions/3.0.0/messageTrait.json": { "$id": "http://asyncapi.com/definitions/3.0.0/messageTrait.json", "type": "object", + "description": "Describes a trait that MAY be applied to a Message Object. This object MAY contain any property from the Message Object, except payload and traits.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -3823,7 +4480,8 @@ }, "properties": { "contentType": { - "type": "string" + "type": "string", + "description": "The content type to use when encoding/decoding a message's payload. The value MUST be a specific media type (e.g. application/json). When omitted, the value MUST be the one specified on the defaultContentType field." }, "headers": { "$ref": "http://asyncapi.com/definitions/3.0.0/anySchema.json" @@ -3884,14 +4542,27 @@ }, "examples": { "type": "array", + "description": "List of examples.", "items": { "type": "object" } }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/messageBindingsObject.json" + } + ] } - } + }, + "examples": [ + { + "contentType": "application/json" + } + ] }, "http://asyncapi.com/definitions/3.0.0/parameters.json": { "$id": "http://asyncapi.com/definitions/3.0.0/parameters.json", @@ -3906,10 +4577,21 @@ } ] }, - "description": "JSON objects describing re-usable channel parameters." + "description": "JSON objects describing re-usable channel parameters.", + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user." + } + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/parameter.json": { "$id": "http://asyncapi.com/definitions/3.0.0/parameter.json", + "description": "Describes a parameter included in a channel address.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -3922,18 +4604,18 @@ "description": "A brief description of the parameter. This could contain examples of use. GitHub Flavored Markdown is allowed." }, "enum": { - "description": "A list of allowed values for the parameter.", + "description": "An enumeration of string values to be used if the substitution options are from a limited set.", "type": "array", "items": { "type": "string" } }, "default": { - "description": "The default value to use for the parameter.", + "description": "The default value to use for substitution, and to send, if an alternate value is not supplied.", "type": "string" }, "examples": { - "description": "List of example values to use for the parameter.", + "description": "An array of examples of the parameter value.", "type": "array", "items": { "type": "string" @@ -3944,11 +4626,23 @@ "description": "A runtime expression that specifies the location of the parameter value", "pattern": "^\\$message\\.(header|payload)#(\\/(([^\\/~])|(~[01]))*)*" } - } + }, + "examples": [ + { + "address": "user/{userId}/signedup", + "parameters": { + "userId": { + "description": "Id of the user.", + "location": "$message.payload#/user/id" + } + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/channelBindingsObject.json", "type": "object", + "description": "Map describing protocol-specific definitions for a channel.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -4133,9 +4827,123 @@ ] }, "nats": {}, - "jms": {}, - "sns": {}, - "sqs": {}, + "jms": { + "properties": { + "bindingVersion": { + "enum": [ + "0.0.1" + ] + } + }, + "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" + } + } + ] + }, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "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" + } + } + ] + }, + "sqs": { + "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/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" + } + } + ] + }, "stomp": {}, "redis": {}, "ibmmq": { @@ -4279,11 +5087,25 @@ "description": "The HTTP method to use when establishing the connection. Its value MUST be either 'GET' or 'POST'." }, "query": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], "description": "A Schema object containing the definitions for each query parameter. This schema MUST be of type 'object' and have a 'properties' key." }, "headers": { - "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/schema.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + } + ], "description": "A Schema object containing the definitions of the HTTP headers to use when establishing the connection. This schema MUST be of type 'object' and have a 'properties' key." }, "bindingVersion": { @@ -4615,10 +5437,10 @@ } ] }, - "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.", + "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": { @@ -4627,13 +5449,472 @@ } }, "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": [ - "topic", - "queue" + "queue", + "fifo-queue" ], - "default": "topic", + "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/sns/0.1.0/channel.json": { + "$id": "http://asyncapi.com/bindings/sns/0.1.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the topic. Can be different from the channel name to allow flexibility around AWS resource naming limitations." + }, + "ordering": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/ordering" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the topic." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "name" + ], + "definitions": { + "ordering": { + "type": "object", + "description": "By default, we assume an unordered SNS topic. This field allows configuration of a FIFO SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "type": { + "type": "string", + "description": "Defines the type of SNS Topic.", + "enum": [ + "standard", + "FIFO" + ] + }, + "contentBasedDeduplication": { + "type": "boolean", + "description": "True to turn on de-duplication of messages for a channel." + } + }, + "required": [ + "type" + ] + }, + "policy": { + "type": "object", + "description": "The security policy for the SNS Topic.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this topic", + "items": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/channel.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SNS permission being allowed or denied e.g. sns:Publish", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "name": "my-sns-topic", + "policy": { + "statements": [ + { + "effect": "Allow", + "principal": "*", + "action": "SNS:Publish" + } + ] + } + } + ] + }, + "http://asyncapi.com/bindings/sqs/0.2.0/channel.json": { + "$id": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json", + "title": "Channel Schema", + "description": "This object contains information about the channel representation in SQS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "queue": { + "description": "A definition of the queue that will be used as the channel.", + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + "deadLetterQueue": { + "description": "A definition of the queue that will be used for un-processable messages.", + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/queue" + }, + "bindingVersion": { + "type": "string", + "enum": [ + "0.1.0", + "0.2.0" + ], + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queue" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/redrivePolicy" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name", + "fifoQueue" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/channel.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] + } + }, + "examples": [ + { + "queue": { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 15, + "visibilityTimeout": 60, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 86400, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + }, + "tags": { + "owner": "AsyncAPI.NET", + "platform": "AsyncAPIOrg" + } + }, + "deadLetterQueue": { + "name": "myQueue_error", + "deliveryDelay": 0, + "visibilityTimeout": 0, + "receiveMessageWaitTime": 0, + "messageRetentionPeriod": 604800 + } + } + ] + }, + "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": { @@ -4924,6 +6205,7 @@ "http://asyncapi.com/definitions/3.0.0/operations.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operations.json", "type": "object", + "description": "Holds a dictionary with all the operations this application MUST implement.", "additionalProperties": { "oneOf": [ { @@ -4933,11 +6215,46 @@ "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" } ] - } + }, + "examples": [ + { + "onUserSignUp": { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ] + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/operation.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operation.json", "type": "object", + "description": "Describes a specific operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -4962,6 +6279,7 @@ }, "messages": { "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation. It MUST contain a subset of the messages defined in the channel referenced in this operation. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" } @@ -4978,6 +6296,7 @@ }, "traits": { "type": "array", + "description": "A list of traits to apply to the operation object. Traits MUST be merged using traits merge mechanism. The resulting object MUST be a valid Operation Object.", "items": { "oneOf": [ { @@ -5006,6 +6325,7 @@ }, "tags": { "type": "array", + "description": "A list of tags for logical grouping and categorization of operations.", "items": { "oneOf": [ { @@ -5029,13 +6349,79 @@ ] }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] } - } + }, + "examples": [ + { + "title": "User sign up", + "summary": "Action to sign a user up.", + "description": "A longer description", + "channel": { + "$ref": "#/channels/userSignup" + }, + "action": "send", + "security": [ + { + "petstore_auth": [ + "write:pets", + "read:pets" + ] + } + ], + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + }, + { + "name": "register" + } + ], + "bindings": { + "amqp": { + "ack": false + } + }, + "traits": [ + { + "$ref": "#/components/operationTraits/kafka" + } + ], + "messages": [ + { + "$ref": "/components/messages/userSignedUp" + } + ], + "reply": { + "address": { + "location": "$message.header#/replyTo" + }, + "channel": { + "$ref": "#/channels/userSignupReply" + }, + "messages": [ + { + "$ref": "/components/messages/userSignedUpReply" + } + ] + } + } + ] }, "http://asyncapi.com/definitions/3.0.0/operationReply.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operationReply.json", "type": "object", + "description": "Describes the reply part that MAY be applied to an Operation Object. If an operation implements the request/reply pattern, the reply object represents the response message.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5058,6 +6444,7 @@ }, "messages": { "type": "array", + "description": "A list of $ref pointers pointing to the supported Message Objects that can be processed by this operation as reply. It MUST contain a subset of the messages defined in the channel referenced in this operation reply. Every message processed by this operation MUST be valid against one, and only one, of the message objects referenced in this list. Please note the messages property value MUST be a list of Reference Objects and, therefore, MUST NOT contain Message Objects. However, it is RECOMMENDED that parsers (or other software) dereference this property for a better development experience.", "items": { "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" } @@ -5067,6 +6454,7 @@ "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operationReplyAddress.json", "type": "object", + "description": "An object that specifies where an operation has to send the reply", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5086,11 +6474,18 @@ "type": "string", "description": "An optional description of the address. CommonMark is allowed." } - } + }, + "examples": [ + { + "description": "Consumer inbox", + "location": "$message.header#/replyTo" + } + ] }, "http://asyncapi.com/definitions/3.0.0/operationTrait.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operationTrait.json", "type": "object", + "description": "Describes a trait that MAY be applied to an Operation Object. This object MAY contain any property from the Operation Object, except the action, channel and traits ones.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5099,31 +6494,55 @@ }, "properties": { "title": { + "description": "A human-friendly title for the operation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/title" }, "summary": { + "description": "A short summary of what the operation is about.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/summary" }, "description": { + "description": "A verbose explanation of the operation. CommonMark syntax can be used for rich text representation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/description" }, "security": { + "description": "A declaration of which security schemes are associated with this operation. Only one of the security scheme objects MUST be satisfied to authorize an operation. In cases where Server Security also applies, it MUST also be satisfied.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/security" }, "tags": { + "description": "A list of tags for logical grouping and categorization of operations.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/tags" }, "externalDocs": { + "description": "Additional external documentation for this operation.", "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/externalDocs" }, "bindings": { - "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json#/properties/bindings" + "description": "A map where the keys describe the name of the protocol and the values describe protocol-specific definitions for the operation.", + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json" + } + ] + } + }, + "examples": [ + { + "bindings": { + "amqp": { + "ack": false + } + } } - } + ] }, "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json": { "$id": "http://asyncapi.com/definitions/3.0.0/operationBindingsObject.json", "type": "object", + "description": "Map describing protocol-specific definitions for an operation.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -5363,8 +6782,84 @@ ] }, "jms": {}, - "sns": {}, - "sqs": {}, + "sns": { + "properties": { + "bindingVersion": { + "enum": [ + "0.1.0" + ] + } + }, + "allOf": [ + { + "description": "If no bindingVersion specified, use the latest binding", + "if": { + "not": { + "required": [ + "bindingVersion" + ] + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.1.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json" + } + } + ] + }, + "sqs": { + "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/sqs/0.2.0/operation.json" + } + }, + { + "if": { + "required": [ + "bindingVersion" + ], + "properties": { + "bindingVersion": { + "const": "0.2.0" + } + } + }, + "then": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json" + } + } + ] + }, "stomp": {}, "redis": {}, "ibmmq": {}, @@ -5747,26 +7242,330 @@ }, "examples": [ { - "groupId": { - "type": "string", - "enum": [ - "myGroupId" - ] - }, - "clientId": { - "type": "string", - "enum": [ - "myClientId" - ] + "groupId": { + "type": "string", + "enum": [ + "myGroupId" + ] + }, + "clientId": { + "type": "string", + "enum": [ + "myClientId" + ] + }, + "bindingVersion": "0.1.0" + } + ] + }, + "http://asyncapi.com/bindings/nats/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/nats/0.1.0/operation.json", + "title": "NATS operation bindings object", + "description": "This object contains information about the operation representation in NATS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "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" + } + ] + }, + "http://asyncapi.com/bindings/sns/0.1.0/operation.json": { + "$id": "http://asyncapi.com/bindings/sns/0.1.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SNS.", + "type": "object", + "additionalProperties": false, + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "topic": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + "description": "Often we can assume that the SNS Topic is the channel name-we provide this field in case the you need to supply the ARN, or the Topic name is not the channel name in the AsyncAPI document." + }, + "consumers": { + "type": "array", + "description": "The protocols that listen to this topic and their endpoints.", + "items": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/consumer" + }, + "minItems": 1 + }, + "deliveryPolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The field is the default for HTTP receivers of the SNS Topic which may be overridden by a specific consumer." + }, + "bindingVersion": { + "type": "string", + "description": "The version of this binding.", + "default": "latest" + } + }, + "required": [ + "consumers" + ], + "definitions": { + "identifier": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "url": { + "type": "string", + "description": "The endpoint is a URL." + }, + "email": { + "type": "string", + "description": "The endpoint is an email address." + }, + "phone": { + "type": "string", + "description": "The endpoint is a phone number." + }, + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding. We don't use $ref because we are referring, not including." + } + } + }, + "consumer": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "protocol": { + "description": "The protocol that this endpoint receives messages by.", + "type": "string", + "enum": [ + "http", + "https", + "email", + "email-json", + "sms", + "sqs", + "application", + "lambda", + "firehose" + ] + }, + "endpoint": { + "description": "The endpoint messages are delivered to.", + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier" + }, + "filterPolicy": { + "type": "object", + "description": "Only receive a subset of messages from the channel, determined by this policy. Depending on the FilterPolicyScope, a map of either a message attribute or message body to an array of possible matches. The match may be a simple string for an exact match, but it may also be an object that represents a constraint and values for that constraint.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "additionalProperties": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string" + }, + { + "type": "object" + } + ] + } + }, + "filterPolicyScope": { + "type": "string", + "description": "Determines whether the FilterPolicy applies to MessageAttributes or MessageBody.", + "enum": [ + "MessageAttributes", + "MessageBody" + ], + "default": "MessageAttributes" + }, + "rawMessageDelivery": { + "type": "boolean", + "description": "If true AWS SNS attributes are removed from the body, and for SQS, SNS message attributes are copied to SQS message attributes. If false the SNS attributes are included in the body." + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/redrivePolicy" + }, + "deliveryPolicy": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/deliveryPolicy", + "description": "Policy for retries to HTTP. The parameter is for that SNS Subscription and overrides any policy on the SNS Topic." + }, + "displayName": { + "type": "string", + "description": "The display name to use with an SNS subscription" + } + }, + "required": [ + "protocol", + "endpoint", + "rawMessageDelivery" + ] + }, + "deliveryPolicy": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "minDelayTarget": { + "type": "integer", + "description": "The minimum delay for a retry in seconds." + }, + "maxDelayTarget": { + "type": "integer", + "description": "The maximum delay for a retry in seconds." + }, + "numRetries": { + "type": "integer", + "description": "The total number of retries, including immediate, pre-backoff, backoff, and post-backoff retries." + }, + "numNoDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with no delay)." + }, + "numMinDelayRetries": { + "type": "integer", + "description": "The number of immediate retries (with delay)." + }, + "numMaxDelayRetries": { + "type": "integer", + "description": "The number of post-backoff phase retries, with the maximum delay between retries." + }, + "backoffFunction": { + "type": "string", + "description": "The algorithm for backoff between retries.", + "enum": [ + "arithmetic", + "exponential", + "geometric", + "linear" + ] + }, + "maxReceivesPerSecond": { + "type": "integer", + "description": "The maximum number of deliveries per second, per subscription." + } + } + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sns/0.1.0/operation.json#/definitions/identifier", + "description": "The SQS queue to use as a dead letter queue (DLQ)." + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + } + }, + "examples": [ + { + "topic": { + "name": "someTopic" }, - "bindingVersion": "0.1.0" + "consumers": [ + { + "protocol": "sqs", + "endpoint": { + "name": "someQueue" + }, + "filterPolicy": { + "store": [ + "asyncapi_corp" + ], + "event": [ + { + "anything-but": "order_cancelled" + } + ], + "customer_interests": [ + "rugby", + "football", + "baseball" + ] + }, + "filterPolicyScope": "MessageAttributes", + "rawMessageDelivery": false, + "redrivePolicy": { + "deadLetterQueue": { + "arn": "arn:aws:SQS:eu-west-1:0000000:123456789" + }, + "maxReceiveCount": 25 + }, + "deliveryPolicy": { + "minDelayTarget": 10, + "maxDelayTarget": 100, + "numRetries": 5, + "numNoDelayRetries": 2, + "numMinDelayRetries": 3, + "numMaxDelayRetries": 5, + "backoffFunction": "linear", + "maxReceivesPerSecond": 2 + } + } + ] } ] }, - "http://asyncapi.com/bindings/nats/0.1.0/operation.json": { - "$id": "http://asyncapi.com/bindings/nats/0.1.0/operation.json", - "title": "NATS operation bindings object", - "description": "This object contains information about the operation representation in NATS.", + "http://asyncapi.com/bindings/sqs/0.2.0/operation.json": { + "$id": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json", + "title": "Operation Schema", + "description": "This object contains information about the operation representation in SQS.", "type": "object", "additionalProperties": false, "patternProperties": { @@ -5775,23 +7574,254 @@ } }, "properties": { - "queue": { - "type": "string", - "description": "Defines the name of the queue to use. It MUST NOT exceed 255 characters.", - "maxLength": 255 + "queues": { + "type": "array", + "description": "Queue objects that are either the endpoint for an SNS Operation Binding Object, or the deadLetterQueue of the SQS Operation Binding Object.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/queue" + } }, "bindingVersion": { "type": "string", "enum": [ - "0.1.0" + "0.1.0", + "0.2.0" ], - "description": "The version of this binding. If omitted, 'latest' MUST be assumed." + "description": "The version of this binding. If omitted, 'latest' MUST be assumed.", + "default": "latest" + } + }, + "required": [ + "queues" + ], + "definitions": { + "queue": { + "type": "object", + "description": "A definition of a queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "$ref": { + "type": "string", + "description": "Allows for an external definition of a queue. The referenced structure MUST be in the format of a Queue. If there are conflicts between the referenced definition and this Queue's definition, the behavior is undefined." + }, + "name": { + "type": "string", + "description": "The name of the queue. When an SNS Operation Binding Object references an SQS queue by name, the identifier should be the one in this field." + }, + "fifoQueue": { + "type": "boolean", + "description": "Is this a FIFO queue?", + "default": false + }, + "deduplicationScope": { + "type": "string", + "enum": [ + "queue", + "messageGroup" + ], + "description": "Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup and queue (default).", + "default": "queue" + }, + "fifoThroughputLimit": { + "type": "string", + "enum": [ + "perQueue", + "perMessageGroupId" + ], + "description": "Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue (default) and perMessageGroupId.", + "default": "perQueue" + }, + "deliveryDelay": { + "type": "integer", + "description": "The number of seconds to delay before a message sent to the queue can be received. Used to create a delay queue.", + "minimum": 0, + "maximum": 15, + "default": 0 + }, + "visibilityTimeout": { + "type": "integer", + "description": "The length of time, in seconds, that a consumer locks a message - hiding it from reads - before it is unlocked and can be read again.", + "minimum": 0, + "maximum": 43200, + "default": 30 + }, + "receiveMessageWaitTime": { + "type": "integer", + "description": "Determines if the queue uses short polling or long polling. Set to zero the queue reads available messages and returns immediately. Set to a non-zero integer, long polling waits the specified number of seconds for messages to arrive before returning.", + "default": 0 + }, + "messageRetentionPeriod": { + "type": "integer", + "description": "How long to retain a message on the queue in seconds, unless deleted.", + "minimum": 60, + "maximum": 1209600, + "default": 345600 + }, + "redrivePolicy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/redrivePolicy" + }, + "policy": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/policy" + }, + "tags": { + "type": "object", + "description": "Key-value pairs that represent AWS tags on the queue." + } + }, + "required": [ + "name" + ] + }, + "redrivePolicy": { + "type": "object", + "description": "Prevent poison pill messages by moving un-processable messages to an SQS dead letter queue.", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "deadLetterQueue": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/identifier" + }, + "maxReceiveCount": { + "type": "integer", + "description": "The number of times a message is delivered to the source queue before being moved to the dead-letter queue.", + "default": 10 + } + }, + "required": [ + "deadLetterQueue" + ] + }, + "identifier": { + "type": "object", + "description": "The SQS queue to use as a dead letter queue (DLQ).", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "arn": { + "type": "string", + "description": "The target is an ARN. For example, for SQS, the identifier may be an ARN, which will be of the form: arn:aws:sqs:{region}:{account-id}:{queueName}" + }, + "name": { + "type": "string", + "description": "The endpoint is identified by a name, which corresponds to an identifying field called 'name' of a binding for that protocol on this publish Operation Object. For example, if the protocol is 'sqs' then the name refers to the name field sqs binding." + } + } + }, + "policy": { + "type": "object", + "description": "The security policy for the SQS Queue", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "statements": { + "type": "array", + "description": "An array of statement objects, each of which controls a permission for this queue.", + "items": { + "$ref": "http://asyncapi.com/bindings/sqs/0.2.0/operation.json#/definitions/statement" + } + } + }, + "required": [ + "statements" + ] + }, + "statement": { + "type": "object", + "patternProperties": { + "^x-[\\w\\d\\.\\x2d_]+$": { + "$ref": "http://asyncapi.com/definitions/3.0.0/specificationExtension.json" + } + }, + "properties": { + "effect": { + "type": "string", + "enum": [ + "Allow", + "Deny" + ] + }, + "principal": { + "description": "The AWS account or resource ARN that this statement applies to.", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "action": { + "description": "The SQS permission being allowed or denied e.g. sqs:ReceiveMessage", + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + } + }, + "required": [ + "effect", + "principal", + "action" + ] } }, "examples": [ { - "queue": "MyCustomQueue", - "bindingVersion": "0.1.0" + "queues": [ + { + "name": "myQueue", + "fifoQueue": true, + "deduplicationScope": "messageGroup", + "fifoThroughputLimit": "perMessageGroupId", + "deliveryDelay": 10, + "redrivePolicy": { + "deadLetterQueue": { + "name": "myQueue_error" + }, + "maxReceiveCount": 15 + }, + "policy": { + "statements": [ + { + "effect": "Deny", + "principal": "arn:aws:iam::123456789012:user/dec.kolakowski", + "action": [ + "sqs:SendMessage", + "sqs:ReceiveMessage" + ] + } + ] + } + }, + { + "name": "myQueue_error", + "deliveryDelay": 10 + } + ] } ] }, @@ -6016,7 +8046,7 @@ "http://asyncapi.com/definitions/3.0.0/components.json": { "$id": "http://asyncapi.com/definitions/3.0.0/components.json", "type": "object", - "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI Specification.", + "description": "An object to hold a set of reusable objects for different aspects of the AsyncAPI specification. All objects defined within the components object will have no effect on the API unless they are explicitly referenced from properties outside the components object.", "additionalProperties": false, "patternProperties": { "^x-[\\w\\d\\.\\x2d_]+$": { @@ -6026,6 +8056,7 @@ "properties": { "schemas": { "type": "object", + "description": "An object to hold reusable Schema Object. If this is a Schema Object, then the schemaFormat will be assumed to be 'application/vnd.aai.asyncapi+json;version=asyncapi' where the version is equal to the AsyncAPI Version String.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6041,6 +8072,7 @@ }, "servers": { "type": "object", + "description": "An object to hold reusable Server Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6056,6 +8088,7 @@ }, "channels": { "type": "object", + "description": "An object to hold reusable Channel Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6071,6 +8104,7 @@ }, "serverVariables": { "type": "object", + "description": "An object to hold reusable Server Variable Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6084,8 +8118,24 @@ } } }, + "operations": { + "type": "object", + "patternProperties": { + "^[\\w\\d\\.\\-_]+$": { + "oneOf": [ + { + "$ref": "http://asyncapi.com/definitions/3.0.0/Reference.json" + }, + { + "$ref": "http://asyncapi.com/definitions/3.0.0/operation.json" + } + ] + } + } + }, "messages": { "type": "object", + "description": "An object to hold reusable Message Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6101,6 +8151,7 @@ }, "securitySchemes": { "type": "object", + "description": "An object to hold reusable Security Scheme Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6116,6 +8167,7 @@ }, "parameters": { "type": "object", + "description": "An object to hold reusable Parameter Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6131,6 +8183,7 @@ }, "correlationIds": { "type": "object", + "description": "An object to hold reusable Correlation ID Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6146,6 +8199,7 @@ }, "operationTraits": { "type": "object", + "description": "An object to hold reusable Operation Trait Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6161,6 +8215,7 @@ }, "messageTraits": { "type": "object", + "description": "An object to hold reusable Message Trait Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6176,6 +8231,7 @@ }, "replies": { "type": "object", + "description": "An object to hold reusable Operation Reply Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6191,6 +8247,7 @@ }, "replyAddresses": { "type": "object", + "description": "An object to hold reusable Operation Reply Address Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6206,6 +8263,7 @@ }, "serverBindings": { "type": "object", + "description": "An object to hold reusable Server Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6221,6 +8279,7 @@ }, "channelBindings": { "type": "object", + "description": "An object to hold reusable Channel Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6236,6 +8295,7 @@ }, "operationBindings": { "type": "object", + "description": "An object to hold reusable Operation Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6251,6 +8311,7 @@ }, "messageBindings": { "type": "object", + "description": "An object to hold reusable Message Bindings Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6266,6 +8327,7 @@ }, "tags": { "type": "object", + "description": "An object to hold reusable Tag Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6281,6 +8343,7 @@ }, "externalDocs": { "type": "object", + "description": "An object to hold reusable External Documentation Objects.", "patternProperties": { "^[\\w\\d\\.\\-_]+$": { "oneOf": [ @@ -6294,7 +8357,142 @@ } } } - } + }, + "examples": [ + { + "components": { + "schemas": { + "Category": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "Tag": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int64" + }, + "name": { + "type": "string" + } + } + }, + "AvroExample": { + "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", + "schema": { + "$ref": "path/to/user-create.avsc#/UserCreate" + } + } + }, + "servers": { + "development": { + "host": "{stage}.in.mycompany.com:{port}", + "description": "RabbitMQ broker", + "protocol": "amqp", + "protocolVersion": "0-9-1", + "variables": { + "stage": { + "$ref": "#/components/serverVariables/stage" + }, + "port": { + "$ref": "#/components/serverVariables/port" + } + } + } + }, + "serverVariables": { + "stage": { + "default": "demo", + "description": "This value is assigned by the service provider, in this example `mycompany.com`" + }, + "port": { + "enum": [ + "5671", + "5672" + ], + "default": "5672" + } + }, + "channels": { + "user/signedup": { + "subscribe": { + "message": { + "$ref": "#/components/messages/userSignUp" + } + } + } + }, + "messages": { + "userSignUp": { + "summary": "Action to sign a user up.", + "description": "Multiline description of what this action does.\nHere you have another line.\n", + "tags": [ + { + "name": "user" + }, + { + "name": "signup" + } + ], + "headers": { + "type": "object", + "properties": { + "applicationInstanceId": { + "description": "Unique identifier for a given instance of the publishing application", + "type": "string" + } + } + }, + "payload": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/userCreate" + }, + "signup": { + "$ref": "#/components/schemas/signup" + } + } + } + } + }, + "parameters": { + "userId": { + "description": "Id of the user." + } + }, + "correlationIds": { + "default": { + "description": "Default Correlation ID", + "location": "$message.header#/correlationId" + } + }, + "messageTraits": { + "commonHeaders": { + "headers": { + "type": "object", + "properties": { + "my-app-header": { + "type": "integer", + "minimum": 0, + "maximum": 100 + } + } + } + } + } + } + } + ] } }, "description": "!!Auto generated!! \n Do not manually edit. "