diff --git a/spec/asyncapi.md b/spec/asyncapi.md index dc5877f7..0f2ee772 100644 --- a/spec/asyncapi.md +++ b/spec/asyncapi.md @@ -273,7 +273,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Info Object Example - + ```json { "title": "AsyncAPI Sample App", @@ -301,7 +301,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml title: AsyncAPI Sample App version: 1.0.1 @@ -335,7 +335,7 @@ Field Name | Type | Description This object MAY be extended with [Specification Extensions](#specificationExtensions). - + ```json { "name": "API Support", @@ -344,7 +344,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml name: API Support url: https://www.example.com/support @@ -366,7 +366,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### License Object Example - + ```json { "name": "Apache 2.0", @@ -374,7 +374,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml name: Apache 2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html @@ -392,7 +392,7 @@ Field Pattern | Type | Description ##### Servers Object Example - + ```json { "development": { @@ -434,7 +434,7 @@ Field Pattern | Type | Description } ``` - + ```yaml development: host: localhost:5672 @@ -487,7 +487,7 @@ Field Name | Type | Description A single server would be described as: - + ```json { "host": "kafka.in.mycompany.com:9092", @@ -497,7 +497,7 @@ A single server would be described as: } ``` - + ```yaml host: kafka.in.mycompany.com:9092 description: Production Kafka broker. @@ -507,7 +507,7 @@ protocolVersion: '3.2' An example of a server that has a `pathname`: - + ```json { "host": "rabbitmq.in.mycompany.com:5672", @@ -517,7 +517,7 @@ An example of a server that has a `pathname`: } ``` - + ```yaml host: rabbitmq.in.mycompany.com:5672 pathname: /production @@ -542,7 +542,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Server Variable Object Example - + ```json { "host": "rabbitmq.in.mycompany.com:5672", @@ -561,7 +561,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml host: 'rabbitmq.in.mycompany.com:5672' pathname: '/{env}' @@ -583,14 +583,14 @@ In case a message can't be encoded/decoded using this value, schema parsers MUST ##### Default Content Type Example - + ```json { "defaultContentType": "application/json" } ``` - + ```yaml defaultContentType: application/json ``` @@ -607,7 +607,7 @@ Field Pattern | Type | Description ##### Channels Object Example - + ```json { "userSignedUp": { @@ -621,7 +621,7 @@ Field Pattern | Type | Description } ``` - + ```yaml userSignedUp: address: 'user.signedup' @@ -653,7 +653,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Channel Object Example - + ```json { "address": "users.{userId}", @@ -695,7 +695,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml address: 'users.{userId}' title: Users channel @@ -742,7 +742,7 @@ Field Pattern | Type | Description ##### Messages Object Example - + ```json { "userSignedUp": { @@ -754,7 +754,7 @@ Field Pattern | Type | Description } ``` - + ```yaml userSignedUp: $ref: '#/components/messages/userSignedUp' @@ -776,7 +776,7 @@ Field Pattern | Type | Description ##### Operations Object Example - + ```json { "onUserSignUp": { @@ -804,7 +804,7 @@ Field Pattern | Type | Description } ``` - + ```yaml onUserSignUp: title: User sign up @@ -849,7 +849,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Operation Object Example - + ```json { "title": "User sign up", @@ -861,6 +861,19 @@ This object MAY be extended with [Specification Extensions](#specificationExtens "action": "send", "security": [ { + "type": "oauth2", + "description": "The oauth security descriptions", + "flows": { + "clientCredentials": { + "tokenUrl": "https://example.com/api/oauth/dialog", + "availableScopes": { + "subscribe:auth_revocations": "Scope required for authorization revocation topic" + } + } + }, + "scopes": [ + "subscribe:auth_revocations" + ], "petstore_auth": [ "write:pets", "read:pets" @@ -881,7 +894,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens { "$ref": "#/components/operationTraits/kafka" } ], "messages": [ - { "$ref": "/components/messages/userSignedUp" } + { "$ref": "#/channels/userSignup/messages/userSignedUp" } ], "reply": { "address": { @@ -891,13 +904,13 @@ This object MAY be extended with [Specification Extensions](#specificationExtens "$ref": "#/channels/userSignupReply" }, "messages": [ - { "$ref": "/components/messages/userSignedUpReply" } + { "$ref": "#/channels/userSignupReply/messages/userSignedUpReply" } ] } } ``` - + ```yaml title: User sign up summary: Action to sign a user up. @@ -906,9 +919,18 @@ channel: $ref: '#/channels/userSignup' action: send security: - - petstore_auth: - - write:pets - - read:pets + - type: oauth2 + description: The oauth security descriptions + flows: + clientCredentials: + tokenUrl: 'https://example.com/api/oauth/dialog' + availableScopes: + 'subscribe:auth_revocations': Scope required for authorization revocation topic + scopes: + - 'subscribe:auth_revocations' + petstore_auth: + - 'write:pets' + - 'read:pets' tags: - name: user - name: signup @@ -917,16 +939,16 @@ bindings: amqp: ack: false traits: - - $ref: "#/components/operationTraits/kafka" + - $ref: '#/components/operationTraits/kafka' messages: - - $ref: '#/components/messages/userSignedUp' + - $ref: '#/channels/userSignup/messages/userSignedUp' reply: address: location: '$message.header#/replyTo' channel: $ref: '#/channels/userSignupReply' messages: - - $ref: '#/components/messages/userSignedUpReply' + - $ref: '#/channels/userSignupReply/messages/userSignedUpReply' ``` #### Operation Trait Object @@ -951,7 +973,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Operation Trait Object Example - + ```json { "bindings": { @@ -962,7 +984,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml bindings: amqp: @@ -1000,7 +1022,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Examples - + ```json { "description": "Consumer inbox", @@ -1008,7 +1030,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml description: Consumer Inbox location: $message.header#/replyTo @@ -1028,7 +1050,7 @@ Field Pattern | Type | Description ##### Parameters Object Example - + ```json { "address": "user/{userId}/signedup", @@ -1040,7 +1062,7 @@ Field Pattern | Type | Description } ``` - + ```yaml address: user/{userId}/signedup parameters: @@ -1066,7 +1088,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Parameter Object Example - + ```json { "address": "user/{userId}/signedup", @@ -1079,7 +1101,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml address: user/{userId}/signedup parameters: @@ -1234,7 +1256,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Message Object Example - + ```json { "name": "UserSignup", @@ -1299,7 +1321,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml name: UserSignup title: User signup @@ -1346,7 +1368,7 @@ examples: Example using Avro to define the payload: - + ```json { "name": "UserSignup", @@ -1367,7 +1389,7 @@ Example using Avro to define the payload: } ``` - + ```yaml name: UserSignup title: User signup @@ -1409,14 +1431,14 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Message Trait Object Example - + ```json { "contentType": "application/json" } ``` - + ```yaml contentType: application/json ``` @@ -1438,7 +1460,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Message Example Object Example - + ```json { "name": "SimpleSignup", @@ -1458,7 +1480,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml name: SimpleSignup summary: A simple UserSignup example message @@ -1492,7 +1514,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Tag Object Example - + ```json { "name": "user", @@ -1500,7 +1522,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml name: user description: User-related messages @@ -1521,7 +1543,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### External Documentation Object Example - + ```json { "description": "Find more info here", @@ -1529,7 +1551,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml description: Find more info here url: https://example.com @@ -1553,14 +1575,14 @@ This object cannot be extended with additional properties and any properties add ##### Reference Object Example - + ```json { "$ref": "#/components/schemas/Pet" } ``` - + ```yaml $ref: '#/components/schemas/Pet' ``` @@ -1610,7 +1632,7 @@ my.org.User ##### Components Object Example - + ```json { "components": { @@ -1744,7 +1766,7 @@ my.org.User } ``` - + ```yaml components: schemas: @@ -1866,7 +1888,7 @@ Name | Allowed values | Notes ###### Multi Format Schema Object Example with Avro - + ```yaml channels: example: @@ -1972,7 +1994,7 @@ As such, inline schema definitions, which do not have a given id, _cannot_ be us ###### Primitive Sample - + ```json { "type": "string", @@ -1980,7 +2002,7 @@ As such, inline schema definitions, which do not have a given id, _cannot_ be us } ``` - + ```yaml type: string format: email @@ -1988,7 +2010,7 @@ format: email ###### Simple Model - + ```json { "type": "object", @@ -2011,7 +2033,7 @@ format: email } ``` - + ```yaml type: object required: @@ -2031,7 +2053,7 @@ properties: For a simple string to string mapping: - + ```json { "type": "object", @@ -2041,7 +2063,7 @@ For a simple string to string mapping: } ``` - + ```yaml type: object additionalProperties: @@ -2050,7 +2072,7 @@ additionalProperties: For a string to model mapping: - + ```json { "type": "object", @@ -2060,7 +2082,7 @@ For a string to model mapping: } ``` - + ```yaml type: object additionalProperties: @@ -2069,7 +2091,7 @@ additionalProperties: ###### Model with Example - + ```json { "type": "object", @@ -2094,7 +2116,7 @@ additionalProperties: } ``` - + ```yaml type: object properties: @@ -2112,7 +2134,7 @@ examples: ###### Model with Boolean Schemas - + ```json { "type": "object", @@ -2126,7 +2148,7 @@ examples: } ``` - + ```yaml type: object required: @@ -2138,7 +2160,7 @@ properties: ###### Models with Composition - + ```json { "schemas": { @@ -2181,7 +2203,7 @@ properties: } ``` - + ```yaml schemas: ErrorModel: @@ -2209,7 +2231,7 @@ schemas: ###### Models with Polymorphism Support - + ```json { "schemas": { @@ -2303,7 +2325,7 @@ schemas: } ``` - + ```yaml schemas: Pet: @@ -2401,21 +2423,21 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ###### User/Password Authentication Sample - + ```json { "type": "userPassword" } ``` - + ```yaml type: userPassword ``` ###### API Key Authentication Sample - + ```json { "type": "apiKey", @@ -2423,7 +2445,7 @@ type: userPassword } ``` - + ```yaml type: apiKey in: user @@ -2431,35 +2453,35 @@ in: user ###### X.509 Authentication Sample - + ```json { "type": "X509" } ``` - + ```yaml type: X509 ``` ###### End-to-end Encryption Authentication Sample - + ```json { "type": "symmetricEncryption" } ``` - + ```yaml type: symmetricEncryption ``` ###### Basic Authentication Sample - + ```json { "type": "http", @@ -2467,7 +2489,7 @@ type: symmetricEncryption } ``` - + ```yaml type: http scheme: basic @@ -2475,7 +2497,7 @@ scheme: basic ###### API Key Sample - + ```json { "type": "httpApiKey", @@ -2484,7 +2506,7 @@ scheme: basic } ``` - + ```yaml type: httpApiKey name: api_key @@ -2493,7 +2515,7 @@ in: header ###### JWT Bearer Sample - + ```json { "type": "http", @@ -2502,7 +2524,7 @@ in: header } ``` - + ```yaml type: http scheme: bearer @@ -2511,7 +2533,7 @@ bearerFormat: JWT ###### Implicit OAuth2 Sample - + ```json { "type": "oauth2", @@ -2530,7 +2552,7 @@ bearerFormat: JWT } ``` - + ```yaml type: oauth2 flows: @@ -2545,14 +2567,14 @@ scopes: ###### SASL Sample - + ```json { "type": "scramSha512" } ``` - + ```yaml type: scramSha512 ``` @@ -2589,7 +2611,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### OAuth Flow Object Examples - + ```json { "authorizationUrl": "https://example.com/api/oauth/dialog", @@ -2601,7 +2623,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml authorizationUrl: https://example.com/api/oauth/dialog tokenUrl: https://example.com/api/oauth/token @@ -2627,7 +2649,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens ##### Examples - + ```json { "description": "Default Correlation ID", @@ -2635,7 +2657,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens } ``` - + ```yaml description: Default Correlation ID location: $message.header#/correlationId