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

chore(blog): added new websocket article #3394

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

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.

Copy link

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.

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! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 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.

Copy link

netlify bot commented Nov 14, 2024

Deploy Preview for asyncapi-website ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 394c543
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-website/deploys/67645cae989e4000087d31bb
😎 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 site 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 33
🟢 Accessibility 98
🟢 Best practices 92
🟢 SEO 100
🔴 PWA 33

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

@AceTheCreator
Copy link
Member Author

Added suggested changes, wyt @derberg?

Copy link

@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

🧹 Outside diff range and nitpick comments (3)
markdown/blog/asyncapi-and-websocket.md (3)

133-152: Add language specifiers to code blocks

Add language specifiers to the fenced code blocks to enable proper syntax highlighting. For example:

-```
+```yaml

Also applies to: 175-175, 210-210, 226-226, 242-242, 261-261, 281-281, 311-311, 325-325, 360-360, 399-399, 421-421

🧰 Tools
🪛 LanguageTool

[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)

🪛 Markdownlint (0.37.0)

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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


38-38: Standardize hyphenation

Use "bidirectional" consistently throughout the document instead of "bi-directional".

Also applies to: 70-70, 150-150

🧰 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)


56-56: Fix subject-verb agreement issues

Several sentences have subject-verb agreement issues. For example:

  • "some of which is maintained" → "some of which are maintained"
  • "what channels looks like" → "what channels look like"
  • "AsyncAPI channels allows" → "AsyncAPI channels allow"
  • "elements that works" → "elements that work"

Also applies to: 66-66, 70-70, 72-72, 97-97, 163-163

🧰 Tools
🪛 LanguageTool

[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)

📜 Review details

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

📥 Commits

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

📒 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)


[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 bi-directional commun...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


[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)


[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: ...in AsyncAPI, not let's see the next key concept which is messages. ### Messages I me...

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~97-~97: This verb does not appear to agree with the subject. Consider using a different form.
Context: ... And here's an example of what messages looks like in an AsyncAPI document Now let's...

(AI_EN_LECTOR_REPLACEMENT_VERB_AGREEMENT)


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

(AI_EN_LECTOR_MISSING_PUNCTUATION_COMMA)


[uncategorized] ~99-~99: 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] ~105-~105: 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)


[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)


[uncategorized] ~163-~163: 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] ~163-~163: 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] ~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)


[uncategorized] ~259-~259: 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] ~389-~389: Consider adding a comma here.
Context: ...Header' ` } As you can see we added a security property to the dev...

(AS_YOU_CAN_SEE_COMMA)


[uncategorized] ~389-~389: 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] ~389-~389: ‘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] ~395-~395: 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] ~414-~414: 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] ~555-~555: 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] ~558-~558: 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] ~578-~578: 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

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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


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

(MD040, fenced-code-language)


421-421: 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: Verify the publication date

The blog post's date is set to December 2024, which is in the future. Consider updating it to a current or past date.


224-224: Use consistent channel notation

As mentioned in previous reviews, avoid using #chat notation when referring to the chat channel. Instead, use either the channel name without the hash symbol or put it in bold.

Also applies to: 238-238, 254-254

🧰 Tools
🪛 LanguageTool

[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)


557-560: Well-structured documentation with practical examples

The article effectively combines theory with practical examples, includes helpful diagrams, and provides valuable references to tools and resources. The section about generating documentation, code, and performing contract testing adds significant value.

🧰 Tools
🪛 LanguageTool

[style] ~558-~558: 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)

sendMessage:
summary: Receive a chat message
description: Allows users to receive messages to the chat room
action: receieve
Copy link

@coderabbitai coderabbitai bot Dec 14, 2024

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix typo in operation action

There's a typo in the operation action:

-    action: receieve
+    action: receive
📝 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
action: receieve
action: receive

Copy link
Member

Choose a reason for hiding this comment

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

@AceTheCreator have a look

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.59%. Comparing base (dc7d0d3) to head (394c543).
Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3394   +/-   ##
=======================================
  Coverage   86.59%   86.59%           
=======================================
  Files          21       21           
  Lines         664      664           
=======================================
  Hits          575      575           
  Misses         89       89           

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

Copy link

@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

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

@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)

Comment on lines +513 to +517
required:
- messageId
- senderId
- content
- timestamp
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Fix YAML indentation in required fields.

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

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

Also applies to: 535-537

Comment on lines +308 to +311
address: /
title: Users channel
messages:
chatMessage:
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
address: /
title: Users channel
messages:
chatMessage:
address: /
title: Users channel
messages:
chatMessage:

Comment on lines +320 to +339
operations:
sendMessage:
...

userJoin:
summary: User join notification
description: Notifies when a new user joins the chat room
action: receive
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/userStatus'

userLeave:
summary: User leave notification
description: Notifies when a user leaves the chat room
action: receive
channel: $ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/userStatus'
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
operations:
sendMessage:
...
userJoin:
summary: User join notification
description: Notifies when a new user joins the chat room
action: receive
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/userStatus'
userLeave:
summary: User leave notification
description: Notifies when a user leaves the chat room
action: receive
channel: $ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/userStatus'
operations:
sendMessage:
...
userJoin:
summary: User join notification
description: Notifies when a new user joins the chat room
action: receive
channel:
$ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/userStatus'
userLeave:
summary: User leave notification
description: Notifies when a user leaves the chat room
action: receive
channel: $ref: '#/channels/chat'
messages:
- $ref: '#/channels/chat/messages/userStatus'

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

Successfully merging this pull request may close these issues.

3 participants