Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adapt HTTP bindings to v3 #204

Merged
merged 8 commits into from
Jul 25, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 31 additions & 30 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` | [Parameters Object][parametersObject] | A Parameters object containing the definitions for each query parameter.
<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,26 @@ 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:
type: request
jonaslagoni marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -74,7 +73,7 @@ This object contains information about the message representation in HTTP.

Field Name | Type | Description
---|:---:|---
<a name="messageBindingObjectHeaders"></a>`headers` | [Schema Object][schemaObject] | A Schema object containing the definitions for HTTP-specific headers. This schema MUST be of type `object` and have a `properties` key.
<a name="messageBindingObjectHeaders"></a>`headers` | [Parameters Object][parametersObject] | A Parameters object containing the definitions for HTTP-specific headers.
jonaslagoni marked this conversation as resolved.
Show resolved Hide resolved
<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.
Expand All @@ -83,8 +82,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 +93,8 @@ 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
[parametersObject]: https://www.asyncapi.com/docs/specifications/latest/#parametersObject