http

Found an error? Have a suggestion?Edit this page on GitHub

HTTP Bindings

This document defines how to describe HTTP-specific information on AsyncAPI.

Version

Current version is 0.3.0.

Server Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.

Channel Binding Object

This object MUST NOT contain any properties. Its name is reserved for future use.

Operation Binding Object

Fixed Fields
Field NameTypeDescription
methodstringThe HTTP method for the request. Its value MUST be one of GET, POST, PUT, PATCH, DELETE, HEAD, OPTIONS, CONNECT, and TRACE.
querySchema Object | Reference ObjectA Schema object containing the definitions for each query parameter. This schema MUST be of type object and have a properties key.
bindingVersionstringThe version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.

Example
1channels:
2  employees:
3    address: /employees
4operations:
5  employees:
6    action: send
7    bindings:
8      http:
9        method: GET
10        query:
11          type: object
12          required:
13            - companyId
14          properties:
15            companyId:
16              type: number
17              minimum: 1
18              description: The Id of the company.
19          additionalProperties: false
20        bindingVersion: '0.3.0'

Message Binding Object

This object contains information about the message representation in HTTP.

Fixed Fields
Field NameTypeDescription
headersSchema Object | Reference ObjectA Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type object and have a properties key.
statusCodenumberThe HTTP response status code according to RFC 9110. statusCode is only relevant for messages referenced by the Operation Reply Object, as it defines the status code for the response. In all other cases, this value can be safely ignored.
bindingVersionstringThe version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.

1channels:
2  test:
3    address: /test
4    messages:
5      testMessage:
6        bindings:
7          http:
8            statusCode: 200
9            headers:
10              type: object
11              properties:
12                Content-Type:
13                  type: string
14                  enum: ['application/json']
15            bindingVersion: '0.3.0'
Was this helpful?
Help us improve the docs by adding your contribution.
OR
Github:AsyncAPICreate Issue on GitHub