-
-
Notifications
You must be signed in to change notification settings - Fork 271
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
Message Payload required or not #928
Comments
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. |
For me it is just an editorial error. Is overwritten by Message Object definition that do not Also schema do not require it either: https://github.com/asyncapi/spec-json-schemas/blob/master/schemas/2.6.0.json#L894 My proposal is to say |
Would the absence of a message payload definition imply "these messages have no payload"? Or simply that the payload is undefined? If this ambiguity is unhelpful, then there might be value in keeping payload as required, but having a way of explicitly specifying it can be empty. |
Making it a required field doesn't make sense from my point of view. Not sure how e.g. Kafka would react to a non present payload. I would prefer to have this as an optional field in the specification. |
Sorry, I didn't explain myself clearly enough. I wasn't questioning whether different messaging/streaming technologies tolerate the absence of a payload. I was considering and discussing the best way to document and describe a message without a payload. Specifically, I was comparing one approach (that omitting the payload section from the doc specifies that there is no payload) with another approach (having a payload section in the AsyncAPI doc, and in that section you can explicitly say that the payload is empty) |
we are having the same situation as with headers, if headers are not provided, does it mean they are unknown or that there are no headers? |
That's true... my assumption would be that if something isn't specified, then it's unknown - that the most likely reason is that the author didn't think to specify it. And that's certainly my assumption with something like headers which are often not documented. I'm not sure I'm strongly arguing for this, more thinking out loud... I was considering something along the lines of authors needing to explicitly specify something like |
We should clarify but I think the absence of type: object
additionalProperties: false or type: 'null' However, I'd be careful with the |
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 ❤️ |
I would suggest to make an editorial change to replace the The source of truth for me (tooling author) are actual objects definitions (Message Object, Channel Object) which supersedes everything else within the specification text. Maybe it would be worth mentioning this inside the spec itself? We're already dealt with the source of truth before in #781. Question about the actual clarity is probably for another issue. For me personally omitting the |
I think we all agree on that by reading the rest of comments. I do, as well. Is anyone willing to create a PR with such a change? @stereomon perhaps? We can move forward on that matter as a first and solid approach. Additional alternatives such as the one commented as well by @fmvilas here can keep evolving apart in this discussion IMHO. |
I already asked this question in the Slack Channel for the Specification and was asked to clarify it with an issue here.
https://www.asyncapi.com/docs/reference/specification/v2.2.0#definitionsMessage (The statement is the same for all higher versions)
It states that a message
MUST
have a payload. But what if I have a command message with the headers containing all the data I need? Do I really need to duplicate the data in the payload?@derberg mentioned that it is confusing that on the message definition level, the spec says
MUST
and in the https://www.asyncapi.com/docs/reference/specification/v2.2.0#messageObject it is not marked asREQUIRED
.From my perspective, it shouldn't be a
MUST
and it shouldn't beREQUIRED
to have a payload defined in each message specifically not when the headers contain all relevant data for me.Is the documentation wrong or do I miss something?
The text was updated successfully, but these errors were encountered: