-
-
Notifications
You must be signed in to change notification settings - Fork 288
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
Establish a mechanism for bindings specs to contribute schema objects for protocol headers #555
Comments
@GeraldLoeffler I need some more explanation. The following is already supported: asyncapi: 2.0.0
info:
title: Account Service
version: 1.0.0
description: This service is in charge of processing user signups
channels:
user/signedup:
subscribe:
bindings:
http:
headers:
$ref: '#/components/schemas/httpHeader'
bindingVersion: '0.1.0'
message:
$ref: '#/components/messages/UserSignedUp'
components:
schemas:
httpHeader:
type: object
properties:
Content-Type:
type: string
enum: ['application/json']
messages:
UserSignedUp:
payload:
type: object
properties:
displayName:
type: string
description: Name of the user
email:
type: string
format: email
description: Email of the user and I understand that this is exactly what you need, so I'm definitely missing something |
@derberg I think that Gerald wants to have some mechanism to add by default the well-known headers for protocols. He wrote:
Your example is similar but isn't this same, because you must define these headers inside your spec and make ref to them. From issue's description I think there should be some defined schema which is used by default or which is easily accessed via Lets wait for response from Gerald :) |
well |
Yep, I agree with you, but lets wait for @GeraldLoeffler :) Gerald also raised this problem (mainly problem with headers in spec and bindings) in the previous SIG meeting, so you can check it in the record. At the moment I can only suggest to have some common data (not only headers) for protocols/bindings inside the |
thanks @magicmatatjahu for interpreting my thoughts and discussing them with @derberg ;) : you're right, my concern is that schemas like I certainly did not want to propose to
but rather to discuss the issue and find an uniform approach for an AsyncAPI document to reference such a common schema of protocol headers. I do think this could be a solution:
However, this should be treated like the other schemas in that directory ( |
@GeraldLoeffler I'm happy that I understood you 😄
yes exactly, that was my idea with |
i propose to use sub-schemas in the main binding schema document for this. Specifically, protocol headers belong logically to the message binding object, and should typically be defined in a See https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-01#section-8.2.4 for sub-schemas and their For example, for HTTP, the following sub-schema should be added to https://github.com/asyncapi/bindings/blob/master/http/json_schemas/message.json:
Then, AsyncAPI documents using the HTTP bindings could use |
agreed (but currently all binding specs are in the same GitHub repo and so will get the same tags) |
This issue has been automatically marked as stale because it has not had recent activity 😴 |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
This issue has been automatically marked as stale because it has not had recent activity 😴 It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation. There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model. Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here. Thank you for your patience ❤️ |
The consensus in bindings specs is for protocol headers (= well-known message headers defined by the server's protocol (HTTP, JMS, Anypoint MQ, ...) rather than by the message sender) to be defined in the
headers
field of the message binding object as schema objects. See for example the HTTP message binding object.But this means that every AsyncAPI document using protocol headers is likely to define a schema object for some of the same well-known protocol headers. For example, for the HTTP protocol headers, an AsyncAPI document might use
and something similar will be repeated in other AsyncAPI documents using the HTTP binding.
To reduce duplication and boilerplate, AsyncAPI binding specification should have a mechanism to provide schema objects for well-known protocol headers. AsyncAPI docs would then just reference these provided schema objects, instead of having to define their own schema objects.
The text was updated successfully, but these errors were encountered: