Skip to content

Conversation

@AceTheCreator
Copy link
Member

@AceTheCreator AceTheCreator commented Nov 14, 2024

A new websocket article using the latest AsyncAPI Spec version.

Summary by CodeRabbit

  • New Features

    • Introduced a comprehensive guide on using AsyncAPI for documenting WebSocket APIs.
    • Added sections covering key concepts like channels, messages, and operations.
    • Provided a step-by-step breakdown for creating an AsyncAPI document for a chat application.
    • Discussed security considerations and protocol-specific bindings.
  • Documentation

    • New blog post titled "AsyncAPI & WebSocket: A Match Made from Heaven?" published.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 14, 2024

Walkthrough

A new file, markdown/blog/asyncapi-and-websocket.md, has been added to the documentation. This file provides a detailed guide on using AsyncAPI for documenting WebSocket APIs, including an overview of the spec-first approach, comparisons with OpenAPI, and explanations of key concepts such as channels, messages, and operations. It also covers security considerations and concludes with a practical example of creating an AsyncAPI document for a chat application.

Changes

File Change Summary
markdown/blog/asyncapi-and-websocket.md New file created with a guide on AsyncAPI for WebSocket APIs, including key concepts, security, and a practical example.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Suggested labels

ready-to-merge

Suggested reviewers

  • derberg
  • quetzalliwrites
  • akshatnema

Poem

In the world of code where rabbits play,
AsyncAPI hops in, brightening the day.
With webs that connect and messages that flow,
A chat application starts to grow!
So gather 'round, let the coding commence,
For in this guide, we find our immense sense! 🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@netlify
Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 38419c6
🔍 Latest deploy log https://app.netlify.com/projects/asyncapi-website/deploys/6886804ca102280008c41c86
😎 Deploy Preview https://deploy-preview-3394--asyncapi-website.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- **SecuritySchemes:** An object that holds reusable security scheme objects
- **Schemas:** and object to hold reusable schema object.

Now, because we want our `#chat` channel to not look overwhelming and difficult to read, we are going to create our message in the component object.
Copy link
Member

Choose a reason for hiding this comment

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

#chat is not a value from asyncapi document but rather a name for a chat channel that you use in article to probably reference too slack channels, or in general channel chat concept, so instead of code from markdown probably leave it without anything or in bold. You use it several times in article, pick one way and be consistent

chatMessage:
$ref: '#/components/messages/chat'

userStatus: #newly added channel message
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think the CodeBlock highlight is working as expected. I thought it was suppose to highlight the lines specified in the props 🤔

Copy link
Member

Choose a reason for hiding this comment

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

looks like there is a bug, it was suppose to highlight, just ain't working anymore, so yeah, I guess you need to fall back to comments in yaml, sorry

I'll report a bug

@asyncapi-bot
Copy link
Contributor

asyncapi-bot commented Dec 14, 2024

⚡️ Lighthouse report for the changes in this PR:

Category Score
🔴 Performance 36
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

Lighthouse ran on https://deploy-preview-3394--asyncapi-website.netlify.app/

@codecov
Copy link

codecov bot commented Dec 17, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d221bfe) to head (38419c6).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #3394   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        22           
  Lines          778       778           
  Branches       144       144           
=========================================
  Hits           778       778           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
markdown/blog/asyncapi-and-websocket.md (1)

38-38: Enhance writing style and consistency.

Consider the following improvements:

  • Replace "bi-directional" with "bidirectional" for consistency with technical writing standards
  • Replace informal phrase "pretty much" with more precise language
  • Fix article usage: "a operation" should be "an operation"
-bi-directional
+bidirectional

-pretty much based on
+primarily based on

-create a operation
+create an operation

Also applies to: 70-70, 72-72, 150-150, 224-224

🧰 Tools
🪛 LanguageTool

[misspelling] ~38-~38: This word is normally spelled as one.
Context: ...e message formats and enabling instant, bi-directional data exchange between client and server...

(EN_COMPOUNDS_BI_DIRECTIONAL)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da23fb5 and 0cb0f05.

📒 Files selected for processing (1)
  • markdown/blog/asyncapi-and-websocket.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
markdown/blog/asyncapi-and-websocket.md

[misspelling] ~38-~38: This word is normally spelled as one.
Context: ...e message formats and enabling instant, bi-directional data exchange between client and server...

(EN_COMPOUNDS_BI_DIRECTIONAL)


[misspelling] ~70-~70: This word is normally spelled as one.
Context: ...ncAPI channels allows us to establish a bi-directional communication between message senders a...

(EN_COMPOUNDS_BI_DIRECTIONAL)


[style] ~72-~72: The phrase ‘pretty much’ can be informal. To strengthen your writing, consider removing it or replacing it with an adverb.
Context: ...a, that's it. Channels in AsyncAPI are pretty much based on a simple idea, Senders send me...

(PRETTY_MUCH)


[misspelling] ~150-~150: This word is normally spelled as one.
Context: ...ioned earlier, AsyncAPI channels enable bi-directional communication between senders and recei...

(EN_COMPOUNDS_BI_DIRECTIONAL)


[grammar] ~163-~163: Did you mean “is being” or “has been”?
Context: ...ny effect on your API unless the object is been explicitly referenced from another prop...

(BEEN_PART_AGREEMENT)


[misspelling] ~224-~224: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...given channel. So now we need to create a operation for our #chat channel and we ...

(EN_A_VS_AN)


[uncategorized] ~224-~224: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...create a operation for our #chat channel and we do that by doing the following: ```...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~254-~254: Did you mean “I”?
Context: ... will fail because in my #chat channel, i have no such message as hello even if...

(I_LOWERCASE_PREMIUM)


[uncategorized] ~254-~254: Did you mean “I”?
Context: ...have no such message as hello even if i have the hello message defined in my ...

(I_LOWERCASE_PREMIUM)


[typographical] ~387-~387: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~387-~387: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~387-~387: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[style] ~393-~393: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[grammar] ~553-~553: Possible agreement error. The noun thing seems to be countable; consider using: “a lot of interesting things”.
Context: ...owed the spec-first approach, we can do a lot of interesting thing with this document, such as: - **Gener...

(A_LOT_OF_NN)


[style] ~556-~556: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)


[style] ~576-~576: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

🔇 Additional comments (2)
markdown/blog/asyncapi-and-websocket.md (2)

1-14: LGTM! Front matter is well-structured.

The metadata is complete and follows the correct YAML format.


574-578: LGTM! References are well-organized and valuable.

The references section provides a good mix of resources including hands-on tutorials, detailed documentation, and community engagement opportunities.

🧰 Tools
🪛 LanguageTool

[style] ~576-~576: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

- $ref: '#/components/securitySchemes/apiKeyHeader'
```

As you can see we added a security property to the development server, and one thing you can notice is i'm specifying it as an array `-$ref` and the reason is because you can pass multiple security types in the security object, and only one of this security scheme needs to be satisfied to authorize a connection. But in our case, we only needed one so yea, let's role with that.
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Correct the security schemes explanation.

The explanation about security schemes is incorrect. When multiple security schemes are specified in an array, ALL schemes must be satisfied, not just one of them. If you want to specify alternative security schemes (OR relationship), you need to use multiple array items.

-and the reason is because you can pass multiple security types in the security object, and only one of this security scheme needs to be satisfied to authorize a connection
+Multiple security schemes in a single array item form an AND relationship, meaning all schemes must be satisfied. To specify alternative schemes (OR relationship), you would need multiple array items.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
As you can see we added a security property to the development server, and one thing you can notice is i'm specifying it as an array `-$ref` and the reason is because you can pass multiple security types in the security object, and only one of this security scheme needs to be satisfied to authorize a connection. But in our case, we only needed one so yea, let's role with that.
As you can see we added a security property to the development server, and one thing you can notice is i'm specifying it as an array `-$ref` and Multiple security schemes in a single array item form an AND relationship, meaning all schemes must be satisfied. To specify alternative schemes (OR relationship), you would need multiple array items. But in our case, we only needed one so yea, let's role with that.
🧰 Tools
🪛 LanguageTool

[typographical] ~387-~387: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~387-~387: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~387-~387: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
markdown/blog/asyncapi-and-websocket.md (4)

31-31: Fix grammatical error in parenthetical explanation.

There's a missing space after the opening parenthesis in the explanation of polling.

-repeatedly pinging the server at intervals(a process known as polling)
+repeatedly pinging the server at intervals (a process known as polling)

70-72: Improve clarity in channels explanation.

The explanation of channels is too brief and contains grammatical errors. Consider expanding the explanation and fixing the grammar.

-The AsyncAPI channels allows us to establish a bidirectional communication between message senders and receivers. yea, that's it.
-
-Channels in AsyncAPI are primarily based on a simple idea, Senders send messages with different contents to be addressed to different channels, and receivers subscribe to these channels to receive these messages.
+AsyncAPI channels enable bidirectional communication between message senders and receivers. They serve as the primary pathways for message exchange in your API.
+
+Channels in AsyncAPI are based on a simple concept: senders publish messages with different content to specific channels, and receivers subscribe to these channels to receive the messages.

127-140: Add language specifier to code block.

Add 'yaml' as the language specifier to enable syntax highlighting.

-```
+```yaml
🧰 Tools
🪛 Markdownlint (0.37.0)

127-127: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


570-570: Improve writing style in references section.

The phrase "feel free to" is informal. Consider a more professional alternative.

-Feel free to check out my [livestream]
+Watch my [livestream]
🧰 Tools
🪛 LanguageTool

[style] ~570-~570: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cb0f05 and 394c543.

📒 Files selected for processing (1)
  • markdown/blog/asyncapi-and-websocket.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
markdown/blog/asyncapi-and-websocket.md

[grammar] ~157-~157: Did you mean “is being” or “has been”?
Context: ...ny effect on your API unless the object is been explicitly referenced from another prop...

(BEEN_PART_AGREEMENT)


[misspelling] ~218-~218: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...given channel. So now we need to create a operation for our chat channel and ...

(EN_A_VS_AN)


[uncategorized] ~218-~218: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ate a operation for our chat channel and we do that by doing the following: ```...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...ll fail because in my chat channel, i have no such message as hello even if...

(I_LOWERCASE_PREMIUM)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...have no such message as hello even if i have the hello message defined in my ...

(I_LOWERCASE_PREMIUM)


[typographical] ~381-~381: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~381-~381: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~381-~381: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[style] ~387-~387: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[grammar] ~547-~547: Possible agreement error. The noun thing seems to be countable; consider using: “a lot of interesting things”.
Context: ...owed the spec-first approach, we can do a lot of interesting thing with this document, such as: - **Gener...

(A_LOT_OF_NN)


[style] ~550-~550: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)


[style] ~570-~570: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

🪛 Markdownlint (0.37.0)
markdown/blog/asyncapi-and-websocket.md

127-127: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


146-146: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


169-169: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


204-204: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


220-220: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


236-236: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


255-255: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


275-275: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


305-305: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


319-319: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


354-354: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


371-371: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


391-391: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


413-413: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
markdown/blog/asyncapi-and-websocket.md (1)

381-381: ⚠️ Potential issue

Correct technical inaccuracy in security scheme explanation.

The explanation of multiple security schemes is incorrect. When security schemes are specified in an array, all schemes must be satisfied (AND relationship), not just one (OR relationship).

-and the reason is because you can pass multiple security types in the security object, and only one of this security scheme needs to be satisfied to authorize a connection
+Multiple security schemes in an array form an AND relationship, meaning all schemes must be satisfied. To specify alternative schemes (OR relationship), you would need multiple array items.

Likely invalid or redundant comment.

🧰 Tools
🪛 LanguageTool

[typographical] ~381-~381: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~381-~381: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~381-~381: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
markdown/blog/asyncapi-and-websocket.md (3)

401-401: Fix typo in property name

There's a typo in the property name.

-            descritpion: The unique identifier of the chat room
+            description: The unique identifier of the chat room

127-127: Add language specifiers to code blocks

For better syntax highlighting and documentation consistency, add the yaml language specifier to all AsyncAPI specification code blocks.

Example:

-```
+```yaml

Also applies to: 146-146, 169-169, 204-204, 220-220, 236-236, 255-255, 275-275, 305-305, 319-319, 354-354, 371-371, 391-391, 413-413

🧰 Tools
🪛 Markdownlint (0.37.0)

127-127: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


70-70: Fix grammar issues

Several grammar issues need attention:

  1. "The AsyncAPI channels allows" → "The AsyncAPI channels allow"
  2. "elements that works" → "elements that work"
  3. "Components in AsyncAPI helps holds" → "Components in AsyncAPI help hold"
  4. "create a operation" → "create an operation"
  5. "enabled connected client" → "enabled a connected client"
  6. "allows us to send message" → "allows us to send a message"

Also applies to: 72-72, 157-157, 218-218, 232-232, 253-253

🧰 Tools
🪛 LanguageTool

[uncategorized] ~70-~70: This verb does not appear to agree with the subject. Consider using a different form.
Context: .... ### Channels The AsyncAPI channels allows us to establish a bidirectional communi...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 394c543 and 28ce8e4.

📒 Files selected for processing (1)
  • markdown/blog/asyncapi-and-websocket.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
markdown/blog/asyncapi-and-websocket.md

[uncategorized] ~56-~56: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...obust ecosystem of tools, some of which is maintained by the AsyncAPI initiative. ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~66-~66: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...ively. Now let's look at what channels looks like in an AsyncAPI document. ### Cha...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~70-~70: This verb does not appear to agree with the subject. Consider using a different form.
Context: .... ### Channels The AsyncAPI channels allows us to establish a bidirectional communi...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~72-~72: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... of a number of different elements that works together to make communication between ...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~72-~72: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...eivers smooth. Some of these components includes, - Address: An optional string tha...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~79-~79: A comma might be missing here.
Context: ...cAPI, let's take a look at the next key concept which is messages. ### Messages I me...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~96-~96: A comma might be missing here.
Context: .... Now let's take a look at another key concept which is called operations ### Operati...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~96-~96: A period might be missing here.
Context: ... at another key concept which is called operations ### Operations Operations are one of ...

(AI_EN_LECTOR_MISSING_PUNCTUATION_PERIOD)


[uncategorized] ~102-~102: You might be missing the article “the” here.
Context: ...ving_ a message in that channel, making message flow clear and structured. Operations ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[uncategorized] ~157-~157: This verb does not appear to agree with the subject. Consider using a different form.
Context: ...component Components in AsyncAPI helps holds a set of reusable objects for different...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[uncategorized] ~157-~157: The grammatical number of this noun doesn’t look right. Consider replacing it.
Context: ...a set of reusable objects for different aspect of the AsyncAPI specification. When you...

(AI_EN_LECTOR_REPLACEMENT_NOUN_NUMBER)


[grammar] ~157-~157: Did you mean “is being” or “has been”?
Context: ...ny effect on your API unless the object is been explicitly referenced from another prop...

(BEEN_PART_AGREEMENT)


[uncategorized] ~159-~159: Possible missing comma found.
Context: ... a set of required elements that can be defined such as the following: - Messages:...

(AI_HYDRA_LEO_MISSING_COMMA)


[misspelling] ~218-~218: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...given channel. So now we need to create a operation for our chat channel and ...

(EN_A_VS_AN)


[uncategorized] ~218-~218: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ate a operation for our chat channel and we do that by doing the following: ```...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~232-~232: Possible missing article found.
Context: ...This basically means we've just enabled connected client to send a message, but not any...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...ll fail because in my chat channel, i have no such message as hello even if...

(I_LOWERCASE_PREMIUM)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...have no such message as hello even if i have the hello message defined in my ...

(I_LOWERCASE_PREMIUM)


[uncategorized] ~253-~253: Possible missing article found.
Context: ... first operation that allows us to send message, we also need to create another operati...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~253-~253: You might be missing the article “the” here.
Context: ...message. And we do that by doing almost same thing as sending a message except, inst...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[typographical] ~381-~381: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~381-~381: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~381-~381: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[style] ~387-~387: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[uncategorized] ~406-~406: The preposition “on” seems more likely in this position than the preposition “in”.
Context: ...making it ideal for exchanging messages in multiple channels simultaneously. ###...

(AI_EN_LECTOR_REPLACEMENT_PREPOSITION_IN_ON)


[grammar] ~547-~547: Possible agreement error. The noun thing seems to be countable; consider using: “a lot of interesting things”.
Context: ...owed the spec-first approach, we can do a lot of interesting thing with this document, such as: - **Gener...

(A_LOT_OF_NN)


[style] ~550-~550: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)


[style] ~570-~570: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

🪛 Markdownlint (0.37.0)
markdown/blog/asyncapi-and-websocket.md

127-127: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


146-146: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


169-169: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


204-204: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


220-220: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


236-236: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


255-255: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


275-275: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


305-305: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


319-319: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


354-354: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


371-371: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


391-391: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


413-413: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (3)
markdown/blog/asyncapi-and-websocket.md (3)

1-14: LGTM!

The front matter is well-structured with all necessary metadata fields.


414-545: LGTM! Well-structured AsyncAPI specification

The AsyncAPI specification is well-organized with:

  • Clear separation of channels, operations, and components
  • Proper use of references
  • Comprehensive security definitions
  • Detailed message schemas

381-381: ⚠️ Potential issue

Correct the security schemes explanation.

The explanation about security schemes is incorrect. When multiple security schemes are specified in an array, ALL schemes must be satisfied, not just one of them. If you want to specify alternative security schemes (OR relationship), you need to use multiple array items.

-and the reason is because you can pass multiple security types in the security object, and only one of this security scheme needs to be satisfied to authorize a connection
+Multiple security schemes in a single array item form an AND relationship, meaning all schemes must be satisfied. To specify alternative schemes (OR relationship), you would need multiple array items.

Likely invalid or redundant comment.

🧰 Tools
🪛 LanguageTool

[typographical] ~381-~381: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~381-~381: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~381-~381: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)

@sambhavgupta0705 sambhavgupta0705 added 📑 docs area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. labels Dec 30, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
markdown/blog/asyncapi-and-websocket.md (3)

127-127: Add language specifiers to code blocks

All code blocks should specify the language for proper syntax highlighting. Add yaml as the language specifier for AsyncAPI specification blocks.

Example:

-```
+```yaml

Also applies to: 146-146, 169-169, 204-204, 220-220, 236-236, 255-255, 275-275, 305-305, 319-319, 353-353, 370-370, 390-390, 412-412

🧰 Tools
🪛 Markdownlint (0.37.0)

127-127: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


463-463: Fix operation name to match its action

The operation name receiveMessage should be consistent with other operation names in the document.

-  receiveMessage:
+  getMessage:

74-74: Fix grammar and spelling issues

Several grammar and spelling issues need attention:

  1. Add missing commas after introductory phrases
  2. Use "an" instead of "a" before "operation"
  3. Capitalize "i" to "I"
  4. Replace "is been" with "has been"

Examples:

-address This could be
+address, This could be

-create a operation
+create an operation

-i have no such message
+I have no such message

-object is been explicitly
+object has been explicitly

Also applies to: 79-79, 96-96, 157-157, 218-218, 248-248, 380-380

🧰 Tools
🪛 LanguageTool

[uncategorized] ~74-~74: Possible missing comma found.
Context: ...nal string that specifies the channel's address This could be a topic name, routing key...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 28ce8e4 and d36f7a0.

📒 Files selected for processing (1)
  • markdown/blog/asyncapi-and-websocket.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
markdown/blog/asyncapi-and-websocket.md

[uncategorized] ~74-~74: Possible missing comma found.
Context: ...nal string that specifies the channel's address This could be a topic name, routing key...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~79-~79: Possible missing comma found.
Context: ...cAPI, let's take a look at the next key concept which is messages. ### Messages I me...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~96-~96: Possible missing comma found.
Context: .... Now let's take a look at another key concept which is called operations ### Operati...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~157-~157: Did you mean “is being” or “has been”?
Context: ...ny effect on your API unless the object is been explicitly referenced from another prop...

(BEEN_PART_AGREEMENT)


[uncategorized] ~159-~159: Possible missing comma found.
Context: ... a set of required elements that can be defined such as the following: - Messages:...

(AI_HYDRA_LEO_MISSING_COMMA)


[misspelling] ~218-~218: Use “an” instead of ‘a’ if the following word starts with a vowel sound, e.g. ‘an article’, ‘an hour’.
Context: ...given channel. So now we need to create a operation for our chat channel and ...

(EN_A_VS_AN)


[uncategorized] ~218-~218: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...ate a operation for our chat channel and we do that by doing the following: ```...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...ll fail because in my chat channel, i have no such message as hello even if...

(I_LOWERCASE_PREMIUM)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...have no such message as hello even if i have the hello message defined in my ...

(I_LOWERCASE_PREMIUM)


[uncategorized] ~253-~253: Possible missing article found.
Context: ... first operation that allows us to send message, we also need to create another operati...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~380-~380: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~380-~380: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~380-~380: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[uncategorized] ~380-~380: Possible missing comma found.
Context: ...ection. But in our case, we only needed one so yea, let's role with that. ### Ste...

(AI_HYDRA_LEO_MISSING_COMMA)


[style] ~386-~386: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[grammar] ~546-~546: Possible agreement error. The noun thing seems to be countable; consider using: “a lot of interesting things”.
Context: ...owed the spec-first approach, we can do a lot of interesting thing with this document, such as: - **Gener...

(A_LOT_OF_NN)


[style] ~549-~549: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)


[style] ~569-~569: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

🪛 Markdownlint (0.37.0)
markdown/blog/asyncapi-and-websocket.md

127-127: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


146-146: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


169-169: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


204-204: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


220-220: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


236-236: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


255-255: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


275-275: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


305-305: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


319-319: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


353-353: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


370-370: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


390-390: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)


412-412: null
Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 180000ms (1)
  • GitHub Check: Test NodeJS PR - macos-13
🔇 Additional comments (2)
markdown/blog/asyncapi-and-websocket.md (2)

3-3: Update the blog post date

The post date is set to January 2025, which is in the future. This might cause issues with blog post sorting and RSS feeds.

Please update the date to a current or past date.


380-380: ⚠️ Potential issue

Correct the security schemes explanation

The explanation about security schemes is incorrect. When multiple security schemes are specified in an array, ALL schemes must be satisfied, not just one of them. If you want to specify alternative security schemes (OR relationship), you need to use multiple array items.

-and the reason is because you can pass multiple security types in the security object, and only one of this security scheme needs to be satisfied to authorize a connection
+Multiple security schemes in a single array item form an AND relationship, meaning all schemes must be satisfied. To specify alternative schemes (OR relationship), you would need multiple array items.

Likely invalid or redundant comment.

🧰 Tools
🪛 LanguageTool

[typographical] ~380-~380: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~380-~380: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~380-~380: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[uncategorized] ~380-~380: Possible missing comma found.
Context: ...ection. But in our case, we only needed one so yea, let's role with that. ### Ste...

(AI_HYDRA_LEO_MISSING_COMMA)

Comment on lines +512 to +516
required:
- messageId
- senderId
- content
- timestamp
Copy link
Contributor

@coderabbitai coderabbitai bot Jan 7, 2025

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix YAML indentation in required fields

The required fields should be aligned with properties at the same level in the YAML structure.

Apply this fix to both message components:

 payload:
   type: object
   properties:
     # ... property definitions ...
-        required:
-          - messageId
-          - senderId
-          - content
-          - timestamp
+   required:
+     - messageId
+     - senderId
+     - content
+     - timestamp

Also applies to: 534-537

Copy link
Member Author

Choose a reason for hiding this comment

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

I checked and it's a false positive suggested changes

Copy link
Contributor

Choose a reason for hiding this comment

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

@AceTheCreator Upon review, this is actually not a false positive. According to the JSON Schema specification, the required field should be at the same level as properties, not nested within it. When required is nested under properties, it's treated as an additional property rather than a schema constraint that lists the required fields. The correct structure should be:

payload:
  type: object
  properties:
    messageId:
      type: string
      # ...other properties
  required:
    - messageId
    # ...other required fields

Would you like me to provide more details about JSON Schema structure, or would you prefer to keep this indentation as is?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
markdown/blog/asyncapi-and-websocket.md (1)

79-79: Address grammar and style issues

Consider the following improvements for better readability:

  • Add missing commas in compound sentences
  • Capitalize "i" to "I" consistently throughout the text
  • Replace "going to" with "will" for more formal tone
  • Fix "a lot of interesting thing" to "things"
  • Consider alternatives to casual phrases like "feel free to"

Also applies to: 96-96, 159-159, 218-218, 232-232, 248-248, 253-253, 380-380, 386-386, 546-546, 569-569

🧰 Tools
🪛 LanguageTool

[uncategorized] ~79-~79: Possible missing comma found.
Context: ...cAPI, let's take a look at the next key concept which is messages. ### Messages I me...

(AI_HYDRA_LEO_MISSING_COMMA)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d36f7a0 and e7418c8.

📒 Files selected for processing (1)
  • markdown/blog/asyncapi-and-websocket.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
markdown/blog/asyncapi-and-websocket.md

[uncategorized] ~79-~79: Possible missing comma found.
Context: ...cAPI, let's take a look at the next key concept which is messages. ### Messages I me...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~96-~96: Possible missing comma found.
Context: .... Now let's take a look at another key concept which is called operations ### Operati...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~159-~159: Possible missing comma found.
Context: ... a set of required elements that can be defined such as the following: - Messages:...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~218-~218: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...te an operation for our chat channel and we do that by doing the following: ```...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~232-~232: Possible missing article found.
Context: ...This basically means we've just enabled connected client to send a message, but not any...

(AI_HYDRA_LEO_MISSING_A)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...have no such message as hello even if i have the hello message defined in my ...

(I_LOWERCASE_PREMIUM)


[uncategorized] ~253-~253: Possible missing article found.
Context: ... first operation that allows us to send message, we also need to create another operati...

(AI_HYDRA_LEO_MISSING_A)


[typographical] ~380-~380: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~380-~380: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~380-~380: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[style] ~386-~386: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[grammar] ~546-~546: Possible agreement error. The noun thing seems to be countable; consider using: “a lot of interesting things”.
Context: ...owed the spec-first approach, we can do a lot of interesting thing with this document, such as: - **Gener...

(A_LOT_OF_NN)


[style] ~549-~549: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)


[style] ~569-~569: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

🔇 Additional comments (3)
markdown/blog/asyncapi-and-websocket.md (3)

3-3: Update the blog post date

The post date is set to 2025-01-10, which is in the future. This might cause issues with content management systems or RSS feeds. Consider updating it to the current date.


192-196: Fix YAML indentation in required fields

The required field should be aligned with properties at the same level in the YAML structure.


380-380: Correct the security schemes explanation

The explanation about security schemes is incorrect. When multiple security schemes are specified in an array, ALL schemes must be satisfied, not just one of them.

🧰 Tools
🪛 LanguageTool

[typographical] ~380-~380: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~380-~380: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~380-~380: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)

Comment on lines 445 to 451
userJoined:
description: Event when a user joins the chat room
$ref: '#/components/messages/status'

userLeft:
description: Event when a user leaves the chat room
$ref: '#/components/messages/status'
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Maintain consistent operation message references

The message references in the operations are inconsistent:

  • In the channel definition: userJoined and userLeft
  • In the operations: userJoin and userLeave

This inconsistency could lead to confusion. Choose one naming convention and stick to it throughout the document.

Also applies to: 477-486

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
markdown/blog/asyncapi-and-websocket.md (2)

31-31: Polish the writing style

Consider these improvements to enhance readability:

  1. Line 31: Add a space after the parenthesis in "intervals(a process"
  2. Line 70: "yea, that's it" sounds informal for a technical article
  3. Line 380: Replace "the reason is because" with "because" to avoid wordiness

Also applies to: 70-70, 380-380


569-569: Make references more professional

Instead of "Feel free to check out", consider using more professional language like "Watch my livestream for..." or "For a detailed walkthrough, refer to my livestream..."

🧰 Tools
🪛 LanguageTool

[style] ~569-~569: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e7418c8 and a74591b.

📒 Files selected for processing (1)
  • markdown/blog/asyncapi-and-websocket.md (1 hunks)
🧰 Additional context used
🪛 LanguageTool
markdown/blog/asyncapi-and-websocket.md

[uncategorized] ~218-~218: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...te an operation for our chat channel and we do that by doing the following: ```...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...have no such message as hello even if i have the hello message defined in my ...

(I_LOWERCASE_PREMIUM)


[typographical] ~380-~380: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~380-~380: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~380-~380: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[style] ~386-~386: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[grammar] ~546-~546: Possible agreement error. The noun thing seems to be countable; consider using: “a lot of interesting things”.
Context: ...owed the spec-first approach, we can do a lot of interesting thing with this document, such as: - **Gener...

(A_LOT_OF_NN)


[style] ~549-~549: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)


[style] ~569-~569: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

🔇 Additional comments (5)
markdown/blog/asyncapi-and-websocket.md (5)

3-3: Update the blog post date

The blog post date is set to January 2025, which is in the future. Consider updating it to a current or past date.


512-516: Fix YAML indentation in required fields

The required fields should be aligned with properties at the same level.

Also applies to: 534-537


477-486: Maintain consistent message references

The message references in the operations are inconsistent:

  • Channel messages use: userJoin and userLeave
  • Operation references use: userJoined and userLeft

380-380: Correct the security schemes explanation

The explanation about security schemes is incorrect. When multiple security schemes are specified in an array, ALL schemes must be satisfied, not just one of them.

🧰 Tools
🪛 LanguageTool

[typographical] ~380-~380: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~380-~380: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~380-~380: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


1-571: Well-structured and comprehensive article!

The article effectively explains the integration of AsyncAPI with WebSocket, providing clear explanations and practical examples. The code samples are well-organized and the concepts are thoroughly explained.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~218-~218: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...te an operation for our chat channel and we do that by doing the following: ```...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~248-~248: Did you mean “I”?
Context: ...have no such message as hello even if i have the hello message defined in my ...

(I_LOWERCASE_PREMIUM)


[typographical] ~380-~380: Consider adding a comma here.
Context: ...ySchemes/apiKeyHeader' ``` As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~380-~380: Did you mean “I”?
Context: ...server, and one thing you can notice is i'm specifying it as an array -$ref and...

(I_LOWERCASE_PREMIUM)


[style] ~380-~380: ‘the reason is because’ might be wordy. Consider a shorter alternative.
Context: ...m specifying it as an array -$ref and the reason is because you can pass multiple security types in...

(EN_WORDINESS_PREMIUM_THE_REASON_IS_BECAUSE)


[style] ~386-~386: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[grammar] ~546-~546: Possible agreement error. The noun thing seems to be countable; consider using: “a lot of interesting things”.
Context: ...owed the spec-first approach, we can do a lot of interesting thing with this document, such as: - **Gener...

(A_LOT_OF_NN)


[style] ~549-~549: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)


[style] ~569-~569: The phrase ‘feel free to’ is used quite frequently. Consider using a less frequent alternative to set your writing apart from others and make it sound more professional.
Context: ...n modern API design. ### References - Feel free to check out my [livestream](https://www.y...

(FEEL_FREE_TO_STYLE_ME)

@thulieblack
Copy link
Member

@AceTheCreator are you still working on the article?

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (2)
markdown/blog/asyncapi-and-websocket.md (2)

376-381: Security-scheme AND/OR semantics still wrong
Spec states that all schemes within one array element are ANDed; alternatives require multiple array items. The explanation claims only one needs to be satisfied.


276-299: required is nested under properties – invalid JSON Schema

In the status message the required array must be a sibling of properties, not inside it, otherwise it is treated as an extra property.

         properties:
@@
-         required:
-           - userId
-           - type
-           - timestamp
+       required:
+         - userId
+         - type
+         - timestamp
🧹 Nitpick comments (7)
markdown/blog/asyncapi-and-websocket.md (7)

2-9: Standardize title punctuation & tag casing

• Add a colon after “WebSocket” and use the idiom “in Heaven”
• Tag value should keep the official casing “WebSocket”.

-title: "AsyncAPI & WebSocket A Match Made from Heaven?"
+title: "AsyncAPI & WebSocket: A Match Made in Heaven?"
@@
-  - Websocket
+  - WebSocket

66-73: Fix grammar & pluralisation in Channels section

“channels allows” → “channels allow”; tighten wording to avoid run-ons.

-### Channels
-
-The AsyncAPI channels allows us to establish a bidirectional communication between message senders and receivers.
-Channels in AsyncAPI are primarily based on a simple idea, Senders send messages with different contents to be addressed to different channels, and receivers subscribe to these channels to receive these messages. But AsyncAPI channels are more than just a message highway, they are made up of a number of different elements that works together to make communication between senders and receivers smooth. Some of these components includes,
+### Channels
+
+AsyncAPI channels allow bidirectional communication between senders and receivers.  A sender publishes messages to a channel and any receiver subscribed to that channel receives them.  Beyond this “message highway”, a channel contains several elements working together to make the exchange smooth.  The key elements include:

119-123: Remove duplicated introductory sentence

The two consecutive sentences introduce the same idea; keep only one to avoid repetition.


207-213: YAML snippet indentation is off

messages: is indented one space more than its siblings, which breaks the example. Align it with address / title to keep the snippet valid.


347-350: Typos & casing in security-scheme paragraph

“HTT API Key scheme” → “HTTP API Key scheme”; also add missing space before “object”.


398-402: Spelling error in bindings example

descritpiondescription


462-470: Inconsistent naming: getMessage vs receiveMessage

Earlier the tutorial refers to a receive operation; consider renaming getMessage to receiveMessage for coherence.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a74591b and 2059bce.

📒 Files selected for processing (1)
  • markdown/blog/asyncapi-and-websocket.md (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: asyncapi-bot
PR: asyncapi/website#0
File: :0-0
Timestamp: 2025-02-18T12:07:42.211Z
Learning: The following PR commands are supported in the asyncapi/website repository:
- `/please-take-a-look` or `/ptal`: Requests attention from reviewers who haven't reviewed the PR
- `/ready-to-merge` or `/rtm`: Triggers automerge when all conditions are met
- `/do-not-merge` or `/dnm`: Blocks automerge even if all conditions are met
- `/autoupdate` or `/au`: Adds autoupdate label to keep PR in sync with target branch
- `/update` or `/u`: One-time update of PR with latest changes from target branch
Learnt from: TRohit20
PR: asyncapi/website#4107
File: markdown/docs/tools/studio/architecture.md:23-23
Timestamp: 2025-05-09T17:35:57.171Z
Learning: In the AsyncAPI Studio architecture documentation, "Layer Breakdown" is intentionally structured as an H3 heading (subsection) because it provides additional detail about the layered architecture pattern introduced earlier, rather than being a standalone main section.
Learnt from: anshgoyalevil
PR: asyncapi/website#3557
File: tests/fixtures/markdown/check-edit-links-data.js:3-11
Timestamp: 2025-01-19T04:51:41.255Z
Learning: In the AsyncAPI website repository, the test data in `tests/fixtures/markdown/check-edit-links-data.js` intentionally includes inconsistent paths (with and without 'docs' prefix) to verify the script's ability to normalize and handle ambiguous path structures.
Learnt from: bandantonio
PR: asyncapi/website#4264
File: markdown/docs/tutorials/getting-started/coming-from-openapi.md:24-25
Timestamp: 2025-07-19T20:58:34.040Z
Learning: In the AsyncAPI website documentation, anchor references to specification sections can use camelCase format (e.g., #serverObject, #parameterObject, #messageObject) even if the actual HTML IDs on the spec page use hyphenated lowercase format. This is acceptable and should not be changed.
Learnt from: anshgoyalevil
PR: asyncapi/website#3557
File: scripts/markdown/check-editlinks.js:58-59
Timestamp: 2025-01-08T15:15:00.759Z
Learning: In the AsyncAPI codebase, batch processing operations (like in the Dashboard script and check-editlinks.js) follow a sequential pattern using await in loops, which is the preferred approach for maintaining consistency across the codebase.
Learnt from: Siddhant-Pragyan-Sinha
PR: asyncapi/website#4074
File: markdown/blog/open-nest.md:11-12
Timestamp: 2025-04-28T01:13:59.084Z
Learning: For AsyncAPI blog posts, author photo filenames don't necessarily need to match the author's official name, as some authors may use pen names or nicknames (e.g., Aishat Muibudeen using "maya_picture.webp" for her avatar).
markdown/blog/asyncapi-and-websocket.md (6)

Learnt from: bandantonio
PR: #4264
File: markdown/docs/tutorials/getting-started/coming-from-openapi.md:24-25
Timestamp: 2025-07-19T20:58:34.040Z
Learning: In the AsyncAPI website documentation, anchor references to specification sections can use camelCase format (e.g., #serverObject, #parameterObject, #messageObject) even if the actual HTML IDs on the spec page use hyphenated lowercase format. This is acceptable and should not be changed.

Learnt from: TRohit20
PR: #4107
File: markdown/docs/tools/studio/architecture.md:23-23
Timestamp: 2025-05-09T17:35:57.171Z
Learning: In the AsyncAPI Studio architecture documentation, "Layer Breakdown" is intentionally structured as an H3 heading (subsection) because it provides additional detail about the layered architecture pattern introduced earlier, rather than being a standalone main section.

Learnt from: anshgoyalevil
PR: #3557
File: tests/fixtures/markdown/check-edit-links-data.js:3-11
Timestamp: 2025-01-19T04:51:41.255Z
Learning: In the AsyncAPI website repository, the test data in tests/fixtures/markdown/check-edit-links-data.js intentionally includes inconsistent paths (with and without 'docs' prefix) to verify the script's ability to normalize and handle ambiguous path structures.

Learnt from: iambami
PR: #4111
File: markdown/blog/community-spotlight-aayush.md:3-3
Timestamp: 2025-06-03T06:48:09.304Z
Learning: For AsyncAPI community spotlight blog posts, the frontmatter date should reflect the actual publication date, not the month being highlighted in the spotlight. For example, a "May Community Spotlight" can be published in June with a June date in the frontmatter.

Learnt from: akshatnema
PR: #3265
File: tests/fixtures/toolsObjectData.js:51-52
Timestamp: 2024-10-09T17:35:36.557Z
Learning: When reviewing code in the 'asyncapi/website' repository, akshatnema prefers that I do not provide committable code suggestions.

Learnt from: anshgoyalevil
PR: #3557
File: scripts/markdown/check-editlinks.js:58-59
Timestamp: 2025-01-08T15:15:00.759Z
Learning: In the AsyncAPI codebase, batch processing operations (like in the Dashboard script and check-editlinks.js) follow a sequential pattern using await in loops, which is the preferred approach for maintaining consistency across the codebase.

🪛 LanguageTool
markdown/blog/asyncapi-and-websocket.md

[style] ~386-~386: Use ‘will’ instead of ‘going to’ if the following action is certain.
Context: ...ser is trying to join, a new connection is going to be established, which doesn't align wel...

(GOING_TO_WILL)


[style] ~549-~549: Consider using a different verb to strengthen your wording.
Context: ...client or server code and models, while speeding up the development process and reducing th...

(SPEED_UP_ACCELERATE)

⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Redirect rules - asyncapi-website
  • GitHub Check: Header rules - asyncapi-website
  • GitHub Check: Pages changed - asyncapi-website
  • GitHub Check: Test NodeJS PR - windows-latest

Comment on lines +256 to +265
operations:
sendMessage:
summary: Receive a chat message
description: Allows users to receive messages to the chat room
action: receive
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/chatMessage'
```
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Operation name clashes with action

The example that demonstrates a receive action is still called sendMessage, creating cognitive dissonance.

-operations:
-  sendMessage:
+operations:
+  receiveMessage:
@@
-    summary: Receive a chat message
+    summary: Receive a chat message
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
operations:
sendMessage:
summary: Receive a chat message
description: Allows users to receive messages to the chat room
action: receive
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/chatMessage'
```
operations:
receiveMessage:
summary: Receive a chat message
description: Allows users to receive messages to the chat room
action: receive
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/chatMessage'
🤖 Prompt for AI Agents
In markdown/blog/asyncapi-and-websocket.md around lines 256 to 265, the
operation name `sendMessage` conflicts with the action `receive`, causing
confusion. Rename the operation from `sendMessage` to a name that clearly
reflects the receive action, such as `receiveMessage`, to align the operation
name with its purpose and improve clarity.

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

Labels

area/docs Specify what technical area given issue relates to. Its goal is to ease filtering good first issues. 📑 docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants