Skip to content

Commit

Permalink
feat: add HTTP status code (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Jan 30, 2024
1 parent 306f1fc commit f3116d7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions http/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This document defines how to describe HTTP-specific information on AsyncAPI.

## Version

Current version is `0.2.0`.
Current version is `0.3.0`.


<a name="server"></a>
Expand All @@ -21,7 +21,6 @@ This object MUST NOT contain any properties. Its name is reserved for future use

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


<a name="operation"></a>

## Operation Binding Object
Expand All @@ -44,7 +43,7 @@ channels:
address: /employees
operations:
employees:
action: send:
action: send
bindings:
http:
method: GET
Expand All @@ -58,10 +57,9 @@ operations:
minimum: 1
description: The Id of the company.
additionalProperties: false
bindingVersion: '0.2.0'
bindingVersion: '0.3.0'
```
<a name="message"></a>
## Message Binding Object
Expand All @@ -73,11 +71,11 @@ This object contains information about the message representation in HTTP.
Field Name | Type | Description
---|:---:|---
<a name="messageBindingObjectHeaders"></a>`headers` | [Schema Object][schemaObject] \| [Reference Object](referenceObject) | A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type `object` and have a `properties` key.
<a name="messageBindingObjectStatusCode"></a>`statusCode` | number | The HTTP response status code according to [RFC 9110](https://httpwg.org/specs/rfc9110.html#overview.of.status.codes). `statusCode` is only relevant for messages referenced by the [Operation Reply Object](https://www.asyncapi.com/docs/reference/specification/v3.0.0#operationReplyObject), as it defines the status code for the response. In all other cases, this value can be safely ignored.
<a name="messageBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.


```yaml
channels:
test:
Expand All @@ -86,13 +84,14 @@ channels:
testMessage:
bindings:
http:
statusCode: 200
headers:
type: object
properties:
Content-Type:
type: string
enum: ['application/json']
bindingVersion: '0.2.0'
bindingVersion: '0.3.0'
```

[schemaObject]: https://github.com/asyncapi/spec/blob/master/spec/asyncapi.md#schemaObject
Expand Down

0 comments on commit f3116d7

Please sign in to comment.