Skip to content

Commit

Permalink
feat: adapt HTTP bindings to v3 (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonaslagoni authored Jul 25, 2023
1 parent 9eb5109 commit 4841cf5
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 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.1.0`.
Current version is `0.2.0`.


<a name="server"></a>
Expand All @@ -15,9 +15,6 @@ Current version is `0.1.0`.

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




<a name="channel"></a>

## Channel Binding Object
Expand All @@ -28,14 +25,13 @@ This object MUST NOT contain any properties. Its name is reserved for future use
<a name="operation"></a>

## Operation Binding Object

##### Fixed Fields

Field Name | Type | Description
---|:---:|---
<a name="operationBindingObjectType"></a>`type` | string | **REQUIRED**. Type of operation. Its value MUST be either `request` or `response`.
<a name="operationBindingObjectMethod"></a>`method` | string | 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`.
<a name="operationBindingObjectQuery"></a>`query` | [Schema Object][schemaObject] | A Schema object containing the definitions for each query parameter. This schema MUST be of type `object` and have a `properties` key.
<a name="operationBindingObjectMethod"></a>`method` | string | The HTTP method for the request. Its value MUST be one of `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`, `CONNECT`, and `TRACE`.
<a name="operationBindingObjectQuery"></a>`query` | [Schema Object][schemaObject] | A Schema object containing the definitions for each query parameter. This schema MUST be of type object and have a properties key.
<a name="operationBindingObjectBindingVersion"></a>`bindingVersion` | string | The version of this binding. If omitted, "latest" MUST be assumed.

This object MUST contain only the properties defined above.
Expand All @@ -44,23 +40,25 @@ This object MUST contain only the properties defined above.

```yaml
channels:
/employees:
subscribe:
bindings:
http:
type: request
method: GET
query:
type: object
required:
- companyId
properties:
companyId:
type: number
minimum: 1
description: The Id of the company.
additionalProperties: false
bindingVersion: '0.1.0'
employees:
address: /employees
operations:
employees:
action: send:
bindings:
http:
method: GET
query:
type: object
required:
- companyId
properties:
companyId:
type: number
minimum: 1
description: The Id of the company.
additionalProperties: false
bindingVersion: '0.2.0'
```
Expand All @@ -83,8 +81,9 @@ This object MUST contain only the properties defined above.
```yaml
channels:
test:
publish:
message:
address: /test
messages:
testMessage:
bindings:
http:
headers:
Expand All @@ -93,7 +92,7 @@ channels:
Content-Type:
type: string
enum: ['application/json']
bindingVersion: '0.1.0'
bindingVersion: '0.2.0'
```

[schemaObject]: https://www.asyncapi.com/docs/specifications/2.0.0/#schemaObject
[schemaObject]: https://www.asyncapi.com/docs/specifications/latest/#schemaObject

0 comments on commit 4841cf5

Please sign in to comment.