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

[Docs Bug 🐞 report]: operation object example incorrect #3177

Open
1 task done
ababkin opened this issue Aug 31, 2024 · 2 comments
Open
1 task done

[Docs Bug 🐞 report]: operation object example incorrect #3177

ababkin opened this issue Aug 31, 2024 · 2 comments

Comments

@ababkin
Copy link

ababkin commented Aug 31, 2024

Describe the bug you found in AsyncAPI Docs.

it specifically says:
"It MUST contain a subset of the messages defined in the channel referenced in this operation, and MUST NOT point to a subset of message definitions located in the Messages Object in the Components Object or anywhere else."

but then the example later reads:

messages:
  - $ref: '#/components/messages/userSignedUp'

this example breaks and is fixed if i follow the original suggestion to reference from the channel messages and not from component messages

Attach any resources that can help us understand the issue.

https://www.asyncapi.com/docs/reference/specification/v3.0.0#channelsObject

Code of Conduct

  • I agree to follow this project's Code of Conduct
Copy link

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.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@ARYPROGRAMMER
Copy link

Hi there! 👋

I believe there might be a misunderstanding in this issue. Let me explain:

  1. Things to understand:

    • Messages in Operation Object MUST contain a subset of messages defined in the channel
    • Messages MUST NOT point to message definitions in the Components Object
  2. What the Specification Actually Says:
    According to the Operation Object specification, the messages field is defined as:

    messages: [[Reference Object]] | A list of `$ref` pointers pointing to the supported Message Objects that can be processed by this operation.
    

I think /component route in definition is actually correct, you see:

image

Components obj has different set of messages defined and thus there's no discrepancy.

I may be missing something, if so do let me know more. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants