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 7 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
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.
jonaslagoni marked this conversation as resolved.
Show resolved Hide resolved
<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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought. Would be cool to have a redirect on the website that would let us point to the latest minor version of a major. For instance, something like:

Suggested change
[schemaObject]: https://www.asyncapi.com/docs/specifications/latest/#schemaObject
[schemaObject]: https://www.asyncapi.com/docs/specifications/3/#schemaObject

Which would redirect to https://www.asyncapi.com/docs/specifications/3.0.0/#schemaObject for now but would resolve to https://www.asyncapi.com/docs/specifications/3.4.0/#schemaObject in the future (when 3.4.0 is out).

Copy link
Member

@smoya smoya Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is not implemented yet, I would love to have this in place. For sure super useful when sharing links to the ref for a particular major version. Did you create an issue in website @fmvilas ?