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

[2.0.0 REVIEW] A case when both contentType and defaultContentType are missing #421

Closed
postatum opened this issue Aug 5, 2020 · 7 comments
Labels
🐞 Bug keep-open Prevents stale bot from closing this issue or PR

Comments

@postatum
Copy link

postatum commented Aug 5, 2020

Looking at the spec, it's not clear whether contentType and defaultContentType are required.

These sections' writing makes ones assume the fields are not required, while others assume they are:

The issue was brought up in this issue asyncapi/tck#26 and reported because of this comment by @fmvilas: asyncapi/tck#26 (comment)

I think you found a gap in the spec, @postatum. There should be a default value for defaultContentType or otherwise make it required (which I don't like). Can you create an issue on asyncapi/asyncapi repo?

@github-actions
Copy link

github-actions bot commented Aug 5, 2020

Welcome to AsyncAPI. Thanks a lot for reporting your first issue.

Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@github-actions
Copy link

github-actions bot commented Oct 5, 2020

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Oct 5, 2020
@derberg derberg removed the stale label Oct 5, 2020
@github-actions
Copy link

github-actions bot commented Dec 5, 2020

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Dec 5, 2020
@fmvilas fmvilas removed the stale label Dec 5, 2020
@fmvilas fmvilas added this to the AsyncAPI specification 2.1.0 milestone Jan 31, 2021
@github-actions
Copy link

github-actions bot commented Apr 2, 2021

This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 60 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions ❤️

@github-actions github-actions bot added the stale label Apr 2, 2021
@derberg derberg added keep-open Prevents stale bot from closing this issue or PR and removed stale labels Apr 2, 2021
@fmvilas fmvilas removed this from the Next specification version milestone May 12, 2021
@c-pius
Copy link

c-pius commented Sep 10, 2021

I also just stumbled over this topic.

messageObject makes the statement When omitted, the value MUST be the one specified on the defaultContentType field

defaultContentType makes the statement This value MUST be used by schema parsers when the contentType property is omitted. In case a message can't be encoded/decoded using this value, schema parsers MUST use their default content type.

I would actually read it like one of them MUST be present and just in case the value of defaultContentType leads to an error when parsing messages, the parser may fallback to its default.

The streetlights example also doesn't seem to have any of them which would be an error according to above reasoning.

@fmvilas
Copy link
Member

fmvilas commented Sep 14, 2021

Yeah, we should probably have a default defaultContentType value so when omitted, it would be application/json for instance.

@fmvilas
Copy link
Member

fmvilas commented Sep 14, 2021

Closing as it's a duplicate of #319

@fmvilas fmvilas closed this as completed Sep 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 Bug keep-open Prevents stale bot from closing this issue or PR
Projects
None yet
Development

No branches or pull requests

4 participants