-
-
Notifications
You must be signed in to change notification settings - Fork 300
docs: update generator-template.md for AsyncAPI v3 parser usage #1551
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
base: master
Are you sure you want to change the base?
docs: update generator-template.md for AsyncAPI v3 parser usage #1551
Conversation
|
""" WalkthroughThe generator template tutorial documentation was revised to focus on AsyncAPI v3.0.0, updating the example AsyncAPI document structure and descriptions accordingly. Minor textual fixes and clarifications were made, while the tutorial’s code examples and instructions remained unchanged. Changes
Assessment against linked issues
Poem
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@Aditya08Vashisht there are some merge conflicts you need to solve |
There was a problem hiding this 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)
apps/generator/docs/generator-template.md (3)
28-38
: Refine blockquote formatting for consistency
The blockquoted note abouttest.mosquitto.org
has multiple spaces after the>
markers (lines 29, 31, 35, 37), triggering markdownlint MD027. To maintain clean blockquotes, use a single space after>
and avoid trailing spaces. For example:- > + >🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
29-29: Multiple spaces after blockquote symbol
null(MD027, no-multiple-space-blockquote)
31-31: Multiple spaces after blockquote symbol
null(MD027, no-multiple-space-blockquote)
35-35: Multiple spaces after blockquote symbol
null(MD027, no-multiple-space-blockquote)
37-37: Multiple spaces after blockquote symbol
null(MD027, no-multiple-space-blockquote)
85-85
: Improve readability of the version-change note
The inline blockquote at line 85 calls out two changes in prose. Consider breaking it into a mini list and wrapping keywords in backticks for clarity:> **New in v3.0.0:** > - `operations` are defined at the document root. > - Channels use `address:` instead of nested `publish`/`subscribe` blocks.
672-672
: Consolidate external resources in “Where to go from here?”
The new MQTT beginners guide link is valuable but could be grouped with the existing two resources as a bulleted list. This will improve scannability:Where to go from here? - …Paho-MQTT template… - …article about creating MQTT client code… - [MQTT beginners guide](https://medium.com/python-point/mqtt-basics-with-python-examples-7c758e605d4)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(4 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/generator/docs/generator-template.md
[uncategorized] ~89-~89: Possible missing comma found.
Context: ...it's important to handle not just errors but also diagnostics (warnings). These help...
(AI_HYDRA_LEO_MISSING_COMMA)
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
29-29: Multiple spaces after blockquote symbol
null
(MD027, no-multiple-space-blockquote)
31-31: Multiple spaces after blockquote symbol
null
(MD027, no-multiple-space-blockquote)
35-35: Multiple spaces after blockquote symbol
null
(MD027, no-multiple-space-blockquote)
37-37: Multiple spaces after blockquote symbol
null
(MD027, no-multiple-space-blockquote)
🔇 Additional comments (1)
apps/generator/docs/generator-template.md (1)
512-514
: Verify<TopicFunction>
integration in the React template
You've injected<TopicFunction channels={asyncapi.channels().filterByReceive()} />
inside a<Text>
component. Please run the generator end-to-end to ensure the nested component correctly emits plain Python function definitions (since<Text>
expects string children).
```yaml | ||
asyncapi: 3.0.0 | ||
info: | ||
title: Temperature Service | ||
version: 1.0.0 | ||
description: This service is in charge of processing all the events related to temperature. | ||
description: Service that emits temperature changes from a bedroom sensor. | ||
|
||
servers: | ||
dev: | ||
url: test.mosquitto.org | ||
production: | ||
host: broker.example.com | ||
protocol: mqtt | ||
|
||
channels: | ||
temperature/changed: | ||
description: Updates the bedroom temperature in the database when the temperatures drops or goes up. | ||
publish: | ||
operationId: temperatureChange | ||
message: | ||
description: Message that is being sent when the temperature in the bedroom changes. | ||
temperatureChanged: | ||
address: temperature/changed | ||
messages: | ||
temperatureChange: | ||
description: Message sent when the temperature in the bedroom changes. | ||
payload: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
temperatureId: | ||
type: string | ||
$ref: '#/components/schemas/Temperature' | ||
|
||
operations: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
❓ Verification inconclusive
Validate the AsyncAPI v3.0.0 YAML snippet
This example now shows a top-level operations
field under asyncapi: 3.0.0
. According to the AsyncAPI 3.0.0 spec, operations are normally defined within channels.publish
or channels.subscribe
. Please verify your parser accepts a root-level operations
block in the YAML, or adjust the snippet to match the official spec.
🏁 Script executed:
#!/usr/bin/env bash
# Validate the AsyncAPI v3.0.0 document for top-level operations support
asyncapi validate test/fixtures/asyncapi.yml
Length of output: 145
Replace the invalid root-level operations
field with channel-level operations
The AsyncAPI 3.0.0 spec does not support a top-level operations
block. All operations must live under a channel’s publish
or subscribe
field. Please remove the standalone operations:
and move its definitions into the relevant channels.
Affected location:
apps/generator/docs/generator-template.md
, lines 45–66
Suggested change (example):
channels:
temperatureChanged:
address: temperature/changed
- messages:
- temperatureChange:
- description: Message sent when the temperature in the bedroom changes.
- payload:
- $ref: '#/components/schemas/Temperature'
+ publish:
+ operationId: temperatureChange
+ summary: Message sent when the temperature in the bedroom changes.
+ message:
+ payload:
+ $ref: '#/components/schemas/Temperature'
-
-operations:
📝 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.
```yaml | |
asyncapi: 3.0.0 | |
info: | |
title: Temperature Service | |
version: 1.0.0 | |
description: This service is in charge of processing all the events related to temperature. | |
description: Service that emits temperature changes from a bedroom sensor. | |
servers: | |
dev: | |
url: test.mosquitto.org | |
production: | |
host: broker.example.com | |
protocol: mqtt | |
channels: | |
temperature/changed: | |
description: Updates the bedroom temperature in the database when the temperatures drops or goes up. | |
publish: | |
operationId: temperatureChange | |
message: | |
description: Message that is being sent when the temperature in the bedroom changes. | |
temperatureChanged: | |
address: temperature/changed | |
messages: | |
temperatureChange: | |
description: Message sent when the temperature in the bedroom changes. | |
payload: | |
type: object | |
additionalProperties: false | |
properties: | |
temperatureId: | |
type: string | |
$ref: '#/components/schemas/Temperature' | |
operations: | |
channels: | |
temperatureChanged: | |
address: temperature/changed | |
publish: | |
operationId: temperatureChange | |
summary: Message sent when the temperature in the bedroom changes. | |
message: | |
payload: | |
$ref: '#/components/schemas/Temperature' |
yes what are they do let me know I'll quickly try to change them! yeah i just closed that PR now! you can now check this new PR now! |
@derberg Please kindly review my PR and merge if its okay as of now.. made all the neccesary changes reqiured in generator-template.md its still pending from yesterday. |
@Aditya08Vashisht in PR in the bottom of tests run you can see "This branch has conflicts that must be resolved" and a button to right Resolve conflicts just click it and you can solve conflicts. |
okay!? done now. |
There was a problem hiding this 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
♻️ Duplicate comments (1)
apps/generator/docs/generator-template.md (1)
87-87
: Inaccurate note about top-leveloperations
The callout still states that v3 supports top-leveloperations
, which conflicts with the AsyncAPI 3.0.0 spec (operations must live under a channel’spublish
/subscribe
).
🧹 Nitpick comments (1)
apps/generator/docs/generator-template.md (1)
91-91
: Add missing comma for clarity
Consider adding a comma after “contact” for better readability:- such as missing recommended fields like `license`, `contact` or outdated spec versions. + such as missing recommended fields like `license`, `contact`, or outdated spec versions.🧰 Tools
🪛 LanguageTool
[uncategorized] ~91-~91: Possible missing comma found.
Context: ...it's important to handle not just errors but also diagnostics (warnings). These help...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/generator/docs/generator-template.md
[uncategorized] ~91-~91: Possible missing comma found.
Context: ...it's important to handle not just errors but also diagnostics (warnings). These help...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Test NodeJS PR - macos-13
- GitHub Check: Test NodeJS PR - windows-latest
const { parseFromFile } = require('@asyncapi/parser'); | ||
|
||
const result = await parseFromFile('example-asyncapi.yaml'); | ||
|
||
if (result.diagnostics && result.diagnostics.length > 0) { | ||
console.warn('⚠️ Found diagnostics:'); | ||
console.dir(result.diagnostics, { depth: null }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Wrap the await
call in an async context
The snippet uses await
at the top level, which will throw unless wrapped in an async function or IIFE. Please adjust the example to ensure it runs as shown.
- const { parseFromFile } = require('@asyncapi/parser');
- const result = await parseFromFile('example-asyncapi.yaml');
- if (result.diagnostics && result.diagnostics.length > 0) {
- console.warn('⚠️ Found diagnostics:');
- console.dir(result.diagnostics, { depth: null });
- }
+ const { parseFromFile } = require('@asyncapi/parser');
+ (async () => {
+ const result = await parseFromFile('example-asyncapi.yaml');
+ if (result.diagnostics && result.diagnostics.length > 0) {
+ console.warn('⚠️ Found diagnostics:');
+ console.dir(result.diagnostics, { depth: null });
+ }
+ })();
📝 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.
const { parseFromFile } = require('@asyncapi/parser'); | |
const result = await parseFromFile('example-asyncapi.yaml'); | |
if (result.diagnostics && result.diagnostics.length > 0) { | |
console.warn('⚠️ Found diagnostics:'); | |
console.dir(result.diagnostics, { depth: null }); | |
} | |
const { parseFromFile } = require('@asyncapi/parser'); | |
(async () => { | |
const result = await parseFromFile('example-asyncapi.yaml'); | |
if (result.diagnostics && result.diagnostics.length > 0) { | |
console.warn('⚠️ Found diagnostics:'); | |
console.dir(result.diagnostics, { depth: null }); | |
} | |
})(); |
@Adi-204 now its resolved! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, looks much better than initially,
added few questions
|
||
servers: | ||
production: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason why it was added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm... Thanks for pointing it out! I added the production: server to better illustrate a more realistic scenario where both a development (dev) and production environment exist — which mirrors many actual use cases. It also supports the explanation later in the tutorial where we discuss dynamically switching brokers using the --param server=dev option. Let me know if you’d prefer I trim it down or clarify it further!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah trim it down, this tutorial do not teach how proper asyncapi document should look like but focus is on extracting data from it and defining a template
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay sure triming down!
|
||
operations: | ||
sendTemperatureChanged: | ||
action: send |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in AsyncAPI v2 publish
means receive
in AsyncPI v3 😄 yeah, I know, weird 😄 but now it means that application can receive a message, not that someone can publish a message that app will receive
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right — with AsyncAPI v3, the semantics around publish and subscribe have flipped compared to v2. I’ve updated the document to reflect this change correctly by using the top-level operations with action: send, aligning with how v3 represents a message sent from the application. Let me know if you'd prefer a more explicit explanation about this change added in the tutorial!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just push the change, I think it is not visible yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah sure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as I wrote, it should be receive
type: object | ||
additionalProperties: false | ||
properties: | ||
temperatureId: | ||
value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why payload had to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was updated to reflect how reusable components are recommended in AsyncAPI v3. By moving the payload to a reusable component (#/components/schemas/Temperature), we promote schema reusability and cleaner code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but I'm not asking about reusability, but why the payload structure changed entirely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual data structure hasn't changed functionally, just refactored into the components/schemas section for cleaner organization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, you changed it, it was temperatureId
and object had one property temperatureId
as string, now it has 2 different properties. So please revert
There was a problem hiding this 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 comments (2)
apps/generator/docs/generator-template.md (2)
405-411
:⚠️ Potential issueInvalid JSON comments in snippet.
Standard JSON does not support inline comments (
# ...
). Either remove the comment or convert the snippet wrapper to JSONC. For example:- "generator": { - # ...(redacted for brevity) - "parameters": { + "generator": { + "parameters": { "server": { "description": "The server you want to use in the code.", "required": true } } }
536-542
:⚠️ Potential issueFix variable name mismatch in
TopicFunction
.You declare
const topicsDetails = getTopics(channels);
but then callchannelsDetails.forEach(...)
. This will throw at runtime. It should be:- channelsDetails.forEach((t) => { + topicsDetails.forEach((t) => {
♻️ Duplicate comments (1)
apps/generator/docs/generator-template.md (1)
102-110
:⚠️ Potential issueWrap
await
in an async context.Using
await
at the top level with CommonJSrequire
will error. Please show the snippet inside an async IIFE or convert to ESM. For example:- const { parseFromFile } = require('@asyncapi/parser'); - const result = await parseFromFile('example-asyncapi.yaml'); + const { parseFromFile } = require('@asyncapi/parser'); + (async () => { + const result = await parseFromFile('example-asyncapi.yaml'); if (result.diagnostics && result.diagnostics.length > 0) { console.warn('⚠️ Found diagnostics:'); console.dir(result.diagnostics, { depth: null }); } + })();
🧹 Nitpick comments (8)
apps/generator/docs/generator-template.md (8)
12-12
: Rephrase for clarity and consistency.The bullet reads “connect to subscribe and publish messages,” but the more typical order is “publish and subscribe.” Consider rewriting to:
- “You’ll use the Eclipse Mosquitto MQTT broker to publish and subscribe to messages using an MQTT client.”
43-44
: Combine or streamline background sentences.These two lines introduce the AsyncAPI document and server‐switching details inline. You might split them into two separate bullets or merge into a single clearer sentence, for example:
“Before creating your template, define an AsyncAPI document with both a
dev
andproduction
server to support parameterized switching.”
51-51
: Quote the version to match spec conventions.In YAML, version strings are usually quoted. Consider:
- asyncapi: 3.0.0 + asyncapi: "3.0.0"
82-89
: Promote schema documentation and examples.Consider adding a brief
description
or anexample
under theTemperature
schema to illustrate usage, e.g.:properties: value: type: number description: The measured temperature value. unit: type: string example: "°C"
92-93
: Shorten or merge notes.The “Note on Payload Schema Refactor” text is informative but may be redundant given the prior
🆕
summary. You could merge these two notes for brevity.
95-95
: Duplicate information—optional removal.This line restates the v3 structure note from above. Consider removing it to avoid repetition.
237-255
: Clean up inline numbering and normalize indentation.The Python snippet contains
# 1
,# 2
, etc. inline comments which may confuse readers. Also, use consistent 4-space indentation for class and method levels. For example:- # 1 - import paho.mqtt.client as mqtt + import paho.mqtt.client as mqtt - # 3 - self.client = mqtt.Client() + self.client = mqtt.Client()
470-476
: Remove debugging comments inside JSX.The
// 2
,// 3
, etc. in your React code will appear in the generated template. Consider moving these numbers into your tutorial text rather than inline code.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(3 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
94-94: Blank line inside blockquote
null
(MD028, no-blanks-blockquote)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Test NodeJS PR - windows-latest
- GitHub Check: Test NodeJS PR - macos-13
🔇 Additional comments (5)
apps/generator/docs/generator-template.md (5)
47-48
: Good note on v3 semantics.This is a helpful explanation of the changed meaning of
publish
/subscribe
in AsyncAPI v3. It’s clear and concise.
55-55
: Service description looks good.The description clearly explains the document’s purpose. No changes needed here.
65-69
: Channels snippet conforms to v3.0.0.Defining
address
and amessages
container here is correct for decoupled operations in v3.0.0. No further changes required.Also applies to: 71-71
73-78
: Top-level operations block is accurate.The use of
operations:
withaction: send
and a channel reference matches the v3.0.0 spec. Looks good.
424-424
: Param flag added correctly.Including
--param server=dev
in the generate script is exactly what's needed to drive the template.
@derberg
Let me know if you'd like any more tweaks! |
There was a problem hiding this 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 (1)
apps/generator/docs/generator-template.md (1)
61-61
: ** Trim or correct the production server entry.**As discussed earlier, since this tutorial focuses on template generation rather than spec details, remove the
production
server block or replace the non-standardhost:
field with a validurl:
andprotocol:
pair.- production: - host: broker.example.com + production: + url: broker.example.com + protocol: mqtt
🧹 Nitpick comments (4)
apps/generator/docs/generator-template.md (4)
42-46
: Consolidate duplicate background context.Lines 42–46 reiterate similar points about focusing on template generation and using a simplified AsyncAPI document. Consider merging these into a single, concise paragraph to reduce redundancy and improve flow.
49-50
: Clarify AsyncAPI v3 semantics note.The v3 semantics note is helpful. You could enhance it with a link to the official migration guide or spec section for readers who want deeper context on the shift from
publish
/subscribe
toaction: send
/receive
.
96-96
: Remove blank line inside blockquote.The blank line at 96 interrupts the blockquote flow. Deleting it will keep the note visually contiguous and avoid unintended paragraph breaks.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
96-96: Blank line inside blockquote
null(MD028, no-blanks-blockquote)
101-101
: Add comma for clarity.Consider adding a comma after “errors” to improve readability:
- handle not just errors but also diagnostics + handle not just errors, but also diagnostics🧰 Tools
🪛 LanguageTool
[uncategorized] ~101-~101: Possible missing comma found.
Context: ...it's important to handle not just errors but also diagnostics (warnings). These help...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(3 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/generator/docs/generator-template.md
[uncategorized] ~101-~101: Possible missing comma found.
Context: ...it's important to handle not just errors but also diagnostics (warnings). These help...
(AI_HYDRA_LEO_MISSING_COMMA)
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
96-96: Blank line inside blockquote
null
(MD028, no-blanks-blockquote)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Acceptance tests for generated templates
- GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (4)
apps/generator/docs/generator-template.md (4)
53-53
: Bump AsyncAPI version.Updating the spec version to 3.0.0 is correct. Ensure that all fixtures and examples consistently reference this new version throughout the tutorial.
67-69
: Approve v3 channel definitions.Using
address
and amessages
container under channels to reference components aligns with AsyncAPI v3’s decoupled model. This change looks correct—just confirm your parser and template logic handle this format as intended.Also applies to: 73-73
75-77
: Approve top-level operations block.Shifting to a root-level
operations
object withaction: send
accurately reflects AsyncAPI v3’s decoupled operations approach. This enhances clarity in both the document and generated templates.
84-84
: Approve reusable schema component.Refactoring the payload into a
Temperature
component withvalue
andunit
properties improves reusability and separation of concerns. The renamed fields also make the schema more intuitive.Also applies to: 88-91
@@ -9,7 +9,7 @@ Suppose you can only sleep when the AC in your bedroom is set to 22 °C, and you | |||
|
|||
In this tutorial: | |||
|
|||
- You'll use the [Eclipse Mosquito](https://test.mosquitto.org) **MQTT broker**, which you'll connect to subscribe and publish messages using an MQTT client. | |||
- You'll use the [Eclipse Mosquitto](https://test.mosquitto.org) **MQTT broker**, which you'll connect to subscribe and publish messages using an MQTT client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Fix incorrect template type in bullet list.
Bullet #3 mentions creating a “React template” but the tutorial focuses on a Python MQTT client template. Update it to “Python template” (or clarify if React is intended here) to avoid confusing readers.
🤖 Prompt for AI Agents
In apps/generator/docs/generator-template.md at line 12, the bullet list
incorrectly refers to a "React template" while the tutorial is about a Python
MQTT client template. Update the text to say "Python template" instead of "React
template" to accurately reflect the tutorial content and avoid reader confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aditya08Vashisht not related to your PR but actually a valid suggestion, can you make an update?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aditya08Vashisht not related to your PR but actually a valid suggestion, can you make an update?
yeah actually as i told you that AI suggested me to do this to be clear and concise for everything this time!
If you feel i can remove it also..
will just wait for your update on this..!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aditya08Vashisht not related to your PR but actually a valid suggestion, can you make an update?
yeah actually as i told you that AI suggested me to do this to be clear and concise for everything this time! If you feel i can remove it also..
will just wait for your update on this..!!
and actually i could i have added but as far my knowledge of the repo i didn't able to find them but still trying my best yet! Its all upto you weather you want the update for this also..?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please update exactly what the rabbit pointed out
There was a problem hiding this 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)
apps/generator/docs/generator-template.md (2)
102-109
: Wrap top-levelawait
in an async context
The snippet showsawait parseFromFile(...)
at the top level. For valid JavaScript, this should be inside anasync
function or an immediately-invoked async function (IIFE).
12-12
: 🛠️ Refactor suggestionUpdate template language in bullet list
The third bullet still refers to a “React template,” but this tutorial is focused on a Python MQTT client template. Please correct it to “Python template” to avoid confusing readers.- - You'll create a React template that will use the MQTT broker to allow you to monitor your bedroom's temperature and notify you when the temperature drops or rises above 22 °C. + - You'll create a Python template that will use the MQTT broker to allow you to monitor your bedroom's temperature and notify you when the temperature drops or rises above 22 °C.
🧹 Nitpick comments (2)
apps/generator/docs/generator-template.md (2)
53-57
: Quote the AsyncAPI version to avoid YAML parsing issues
Unquoted3.0.0
may be parsed as a float in YAML. Wrapping it in quotes ensures it remains a string.- asyncapi: 3.0.0 + asyncapi: "3.0.0"
92-95
: Clean up blockquote formatting
There’s a blank line within the blockquote (> …
). Remove extra blank lines so each quoted line flows without gaps, ensuring consistent markdown rendering.🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
94-94: Blank line inside blockquote
null(MD028, no-blanks-blockquote)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(3 hunks)
🧰 Additional context used
🪛 LanguageTool
apps/generator/docs/generator-template.md
[uncategorized] ~99-~99: Possible missing comma found.
Context: ...it's important to handle not just errors but also diagnostics (warnings). These help...
(AI_HYDRA_LEO_MISSING_COMMA)
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
94-94: Blank line inside blockquote
null
(MD028, no-blanks-blockquote)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Acceptance tests for generated templates
- GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (4)
apps/generator/docs/generator-template.md (4)
49-50
: Clarify AsyncAPI v3 semantics
Excellent addition. This clearly explains the shift inpublish
/subscribe
semantics under the top-leveloperations
in AsyncAPI v3, which is crucial context for readers.
65-69
: AsyncAPI channels useaddress
&messages
containers
Well done refactoring thechannels
block to useaddress
andmessages
, and extracting the payload to a reusable component reference. This aligns perfectly with AsyncAPI v3 best practices.Also applies to: 71-71
73-75
: Top-leveloperations
block is correct for AsyncAPI v3
ThesendTemperatureChanged
operation withaction: send
and a channel reference matches the v3 spec’s decoupled operations model.
82-89
: Refactored payload schema component
Converting the inline payload into aTemperature
component schema with strictadditionalProperties: false
and clearvalue
/unit
fields improves reusability and readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aditya08Vashisht hey man, are you using AI to do this PR? I do not want to spend so much time reviewing stuff that is not needed. It's like you do not listen to my feedback at all and do all things 1:1 only with AI with no value from your side.
I hope you are not affiliated with Outlier AI or anything like that as this is unethical.
Yes i took suggestions from AI for that PR to be thoroughly clear this time! (like the Mosquitto thing) Please clarify me more what else did you feel that was via AI from your strong response i feel i will never use AI for any extra suggestion for the open src contributions. |
was talking about this thing bro @coderabbitai[bot] |
Tip For best results, initiate chat on the files or code changes. @Aditya08Vashisht I see what you're asking about now! The "Duplicate comments (1)" in the review summary means CodeRabbit detected one comment that was similar enough to an existing comment that it considered it a duplicate and didn't post it again. This happens when the review system finds issues that overlap or are very similar to each other. Unfortunately, without access to the full review details, I can't tell you exactly which comment was flagged as a duplicate. To find it, you'd typically need to look at the complete review in the CodeRabbit interface. The duplicate is likely related to one of the 6 nitpick comments that were successfully posted. For now, I'd recommend focusing on addressing the 6 nitpick comments that were successfully posted, as those are the ones you'll need to fix. The duplicate comment won't appear in your PR since it wasn't posted. Let me know if you need any more help with implementing those fixes! |
okay that means almost 99.99% of the things are clear from my side now @coderabbitai[bot] |
Tip For best results, initiate chat on the files or code changes. @Aditya08Vashisht Great! Glad to hear you have a clear understanding of what needs to be addressed now. Your work updating the generator template documentation for AsyncAPI v3 is valuable, and these small tweaks will make it even better. If you need any help implementing the suggested changes or have questions about any specific point, just let me know. I'm here to help make this PR as smooth as possible. If you found this review helpful, would you consider giving us a shout-out on X? Thank you for using CodeRabbit! |
There was a problem hiding this 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)
apps/generator/docs/generator-template.md (2)
49-50
: Add link to AsyncAPI v3.0 specification
Consider including a hyperlink to the official AsyncAPI 3.0.0 spec in this note to guide readers who want full details on the semantics change. For example:> 🧭 **Note on AsyncAPI v3 semantics:** See [AsyncAPI 3.0.0 Spec](https://www.asyncapi.com/docs/reference/specification/v3.0.0) for full details.
71-71
: Inline YAML comment could be confusing
The comment trailing the$ref
line may be misinterpreted as part of the YAML snippet. Consider moving this note into the surrounding Markdown or placing it above the code block for clarity.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(4 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
94-94: Blank line inside blockquote
null
(MD028, no-blanks-blockquote)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Acceptance tests for generated templates
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (8)
apps/generator/docs/generator-template.md (8)
12-12
: Clear introduction of MQTT broker usage
The updated bullet provides a concise and accurate description of using Eclipse Mosquitto as the MQTT broker and its role in the tutorial.
42-45
: Focused tutorial scope highlighted
Moving the note about focusing on template generation close to the background context helps readers immediately understand the tutorial’s purpose.
53-53
: Quote the version string per YAML best practices
Using quotes around3.0.0
ensures proper YAML parsing and aligns with common conventions.
57-57
: Service description is concise and clear
The description clearly conveys the purpose of the Temperature Service without unnecessary detail.
65-67
: Channels block updated for v3 consistency
Switching to theaddress
andmessages
structure correctly reflects AsyncAPI v3 channel definitions and improves clarity.
73-79
: Root-level operations usage aligns with AsyncAPI v3
Definingoperations
at the top level withaction: send
adheres to v3.0.0 and clearly indicates the intent of the message.
82-89
: Reusable Temperature schema is well-structured
Extracting the payload into aTemperature
component withvalue
andunit
properties follows best practices for reuse and separation of concerns.
681-681
: Helpful additional reading link
The link to the MQTT beginners guide offers readers an optional deep dive into MQTT fundamentals.
hey @derberg I personally feel not as this just putting unneceasry suggestions now i feel! if all the things are okay now please merge or ask me for anything more |
> 🛠️ **Note on Payload Schema Refactor:** | ||
> The payload was previously inline with a field like temperatureId. In this version, it’s refactored into a reusable Temperature schema component. While the field names were also cleaned up (temperatureId → value, unit), the functional meaning remains unchanged. This aligns with AsyncAPI v3's best practices for reuse and separation of concerns. Only the naming changed (temperatureId → value) to more clearly match the data's purpose. This is purely cosmetic and doesn’t affect function. | ||
|
||
> 🆕 This document uses the AsyncAPI 3.0.0 structure. Notable changes include `operations` now being top-level and the use of `address:` in `channels` instead of nested publish/subscribe. | ||
## Handling Diagnostics (Warnings) | ||
|
||
When using the latest AsyncAPI parser, it's important to handle not just errors, but also diagnostics (warnings). These help identify non-critical issues, such as missing recommended fields like `license`, `contact`, or outdated spec versions. | ||
|
||
```ts | ||
const { parseFromFile } = require('@asyncapi/parser'); | ||
|
||
const result = await parseFromFile('example-asyncapi.yaml'); | ||
|
||
if (result.diagnostics && result.diagnostics.length > 0) { | ||
console.warn('⚠️ Found diagnostics:'); | ||
console.dir(result.diagnostics, { depth: null }); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but what is all of this? it is 1:1 taken from AI while having it in this document makes no sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right @derberg — this part went overboard and veered too far into speculative explanation. I've trimmed it down to a short, contextual note that sticks to the tutorial's scope and keeps the focus on code generation, not AsyncAPI internals. Thanks for pointing it out!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so finally..! I've trimmed down the payload note to focus strictly on what changed and why — namely the move to a reusable schema component and slight renaming for clarity, without any functional change. Also retained the AsyncAPI v3 structural callout to highlight top-level operations and channel addressing updates.
Let me know if anything still feels too verbose or out of scope — happy to tweak further!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally talking about the 1:1 AI thing..
I have always constantly given my own work (just only guided by the AI) it is just that i am sick since last 5 days (after wednesday's meeting) and now i have taken the some good level help from the chatbots and AI and given less attention to the issue in person..
i have also worked on testing and file chaging type of issues on my own .. many & many times (like the previous which i have tested and helped to close that issue with ease)
..after that i can't explain my hardwork more than this for the project that i always wants to stick with, learn and grow more..
There was a problem hiding this 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
♻️ Duplicate comments (1)
apps/generator/docs/generator-template.md (1)
14-14
:⚠️ Potential issueCorrect the template type to match the tutorial scope
The item still mentions a “React template,” but this guide is about a Python MQTT client template. Please update accordingly:- - You'll create a React template that will use the MQTT broker to allow you to monitor your bedroom's temperature and notify you when the temperature drops or rises above 22 °C. + - You'll create a Python MQTT client template that will use the MQTT broker to allow you to monitor your bedroom's temperature and notify you when the temperature drops or rises above 22 °C.🧰 Tools
🪛 LanguageTool
[style] ~14-~14: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the MQTT client in this project. - You'll create a React template that will us...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🧹 Nitpick comments (2)
apps/generator/docs/generator-template.md (2)
71-71
: Remove inline comment from code block
Inline comments in YAML code blocks can be confusing to readers. Consider removing the trailing# refactored…
comment and moving it into the prose immediately below the snippet.
122-122
: Optional: Remove transitional phrase
The standalone “Let’s break it down:” line immediately precedes a sub-heading. Consider removing it or merging its meaning into the heading for cleaner flow.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(4 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
94-94: Blank line inside blockquote
null
(MD028, no-blanks-blockquote)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Acceptance tests for generated templates
- GitHub Check: Test NodeJS PR - windows-latest
- GitHub Check: Test NodeJS PR - macos-13
🔇 Additional comments (7)
apps/generator/docs/generator-template.md (7)
12-12
: Well-defined prerequisite for broker setup
The addition of the Eclipse Mosquitto broker bullet clearly sets up the MQTT context for readers.
42-45
: Background context focuses tutorial correctly
Clarifying that this tutorial is about code generation (not full spec modeling) and pointing users to community templates if needed aligns with the PR objective to trim down and focus the content.
49-50
: Excellent AsyncAPI v3 semantics note
This call-out on the flip inpublish
/subscribe
semantics and the newoperations.action: send
model is very helpful for readers migrating to v3.
53-53
: Quote the AsyncAPI version
Enclosing3.0.0
in quotes adheres to YAML best practices and avoids parsing errors.
57-57
: Improved service description
The updated description line succinctly summarizes the service’s purpose.
73-79
: Top-leveloperations
block is correctly updated
The newoperations
object withaction: send
and channel reference matches the v3 treatment and is consistent with the tutorial’s simplified model.
65-68
:❓ Verification inconclusive
Verify use of
messages
underchannels
in v3
The snippet uses amessages:
container inside the channel definition. Please confirm that the AsyncAPI 3.0.0 spec and your parser supportchannels.X.messages
(rather thanpublish
/subscribe
) or adjust to the official schema.
🏁 Script executed:
#!/usr/bin/env bash # Validate a minimal v3.0.0 snippet for channel->messages support cat << 'EOF' > /tmp/asyncapi.yml asyncapi: "3.0.0" channels: temperatureChanged: address: temperature/changed messages: temperatureChange: payload: type: object EOF asyncapi validate /tmp/asyncapi.ymlLength of output: 143
Verify AsyncAPI spec support for
messages
underchannels
I attempted to validate this snippet with the AsyncAPI CLI but theasyncapi
command isn’t available in this environment. Please confirm that your target AsyncAPI version (3.0.0) supports achannels[].messages
block, or adjust to the officialpublish
/subscribe
syntax to ensure your docs remain compliant.• Locally install and validate with the AsyncAPI CLI:
npm install -g @asyncapi/cli asyncapi validate apps/generator/docs/generator-template.md• If
channels.X.messages
isn’t supported, update to usepublish
orsubscribe
, for example:temperatureChanged: address: temperature/changed subscribe: message: $ref: '#/components/messages/temperatureChange'Please verify and adjust as needed.
There was a problem hiding this 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 (1)
apps/generator/docs/generator-template.md (1)
14-14
: 🛠️ Refactor suggestionCorrect the bullet to reflect the Python template focus
The tutorial is about creating a Python MQTT client template, not a React template. Please update the bullet accordingly.- - You'll create a React template that will use the MQTT broker to allow you to monitor your bedroom's temperature... + - You'll create a Python template that will use the MQTT broker to allow you to monitor your bedroom's temperature...🧰 Tools
🪛 LanguageTool
[style] ~14-~14: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the MQTT client in this project. - You'll create a React template that will us...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
🧹 Nitpick comments (1)
apps/generator/docs/generator-template.md (1)
92-94
: Fix typo and remove blank line in blockquote
There’s a typo (“n this version”) and an extra blank line inside the blockquote. Please apply:> 🛠️ **Note on Payload Schema Refactor:** - > n this version, the payload definition has been moved… + > In this version, the payload definition has been moved…Also remove the blank line between lines 93 and 94 to satisfy MD028.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
94-94: Blank line inside blockquote
null(MD028, no-blanks-blockquote)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(4 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
94-94: Blank line inside blockquote
null
(MD028, no-blanks-blockquote)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Acceptance tests for generated templates
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Test NodeJS PR - macos-13
- GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (9)
apps/generator/docs/generator-template.md (9)
12-12
: The first bullet correctly describes the MQTT broker usage; no changes required here.
42-42
: The note emphasizing focus on template code generation is clear and singular; no duplication remains.
44-45
: These introductory lines describing community templates and setup are informative and do not require modification.
49-51
: Approve AsyncAPI v3 semantics note
The explanation of the changedpublish
/subscribe
semantics and use ofaction: send
under top-leveloperations
is accurate and aligns with AsyncAPI v3.0.0.
53-53
: Approve version quoting
Quoting the version string ("3.0.0"
) is correct per YAML best practices and AsyncAPI examples.
65-71
: Approve channel definition update
The channel snippet correctly usesaddress
andmessages
as per AsyncAPI v3.0.0 spec.
73-79
: Approve top-level operations usage
Theoperations
block withaction: send
and channel reference is valid for AsyncAPI v3.0.0.
95-95
: The summary note accurately highlights the AsyncAPI 3.0.0 structural changes; no edits needed.
671-671
: The additional link to the MQTT beginners guide is optional context and may remain or be removed at your discretion.
There was a problem hiding this 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)
apps/generator/docs/generator-template.md (4)
12-15
: Inconsistent bullet list item: React vs Python template
The tutorial is focused on Python MQTT client templates, but bullet #3 still references a “React template”. This will confuse readers. Update the bullet list to reflect “Python template” instead of “React template”.- - You'll create a React template that will use the MQTT broker to allow you to monitor your bedroom's temperature and notify you when the temperature drops or rises above 22 °C. + - You'll create a Python template that will use the MQTT broker to allow you to monitor your bedroom's temperature and notify you when the temperature drops or rises above 22 °C.🧰 Tools
🪛 LanguageTool
[style] ~14-~14: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... the MQTT client in this project. - You'll create a React template that will us...(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
92-94
: Streamline payload schema note
The blockquote contains redundant phrasing, an extra blank line (triggering MD028), and a misleading “doesn't affect functionality” claim. Consider tightening it:- > 🛠️ **Note on Payload Schema Refactor:** - > In this version, the payload definition has been moved to a reusable schema component (#/components/schemas/Temperature). This change reflects AsyncAPI v3 best practices, but doesn't affect functionality. This aligns with AsyncAPI v3's best practices for reuse and separation of concerns. The payload was also updated to include a unit field (e.g., °C, °F) to better reflect real-world temperature data. While this introduces a slight schema expansion, it enhances clarity for generated code consumers. The value field replaces the previous temperatureId for clearer semantics. + > 🛠️ **Note on Payload Schema Refactor:** + > The payload has been moved to a reusable schema component (#/components/schemas/Temperature) and updated to include a `unit` field (e.g., °C, °F) to reflect real-world data. This aligns with AsyncAPI v3 best practices for separation of concerns.Also remove the blank line after the blockquote to satisfy markdownlint.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)
94-94: Blank line inside blockquote
null(MD028, no-blanks-blockquote)
95-95
: Remove duplicate structure note
The final callout reiterates changes already mentioned earlier. To avoid redundancy, consider removing or merging this line with the earlier AsyncAPI v3 semantics note.
671-671
: Integrate additional resource into the closing section
The MQTT beginners guide link is a valuable resource but feels tacked on at the end. It would be more coherent if it were moved under the “Where to go from here?” section alongside other external links.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
apps/generator/docs/generator-template.md
(4 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
apps/generator/docs/generator-template.md
94-94: Blank line inside blockquote
null
(MD028, no-blanks-blockquote)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: Acceptance tests for generated templates
- GitHub Check: Test generator as dependency with Node 20
- GitHub Check: Test generator as dependency with Node 18
- GitHub Check: Test NodeJS PR - macos-13
- GitHub Check: Test NodeJS PR - windows-latest
🔇 Additional comments (4)
apps/generator/docs/generator-template.md (4)
42-47
: Background context is clear and focused
The new section correctly emphasizes that this tutorial is about code generation with templates, not full AsyncAPI modeling, and sets up the AsyncAPI document context cleanly. Great improvement.
49-50
: Approve AsyncAPI v3 semantics note
The callout accurately explains the change in publish/subscribe semantics and the introduction of the top-leveloperations
block withaction: send
. This is concise and helpful for readers.
53-53
: Approve version string quoting
Quoting the version as"3.0.0"
adheres to YAML best practices and avoids potential parsing issues.
65-73
: Approve channels & operations snippet
The example correctly reflects AsyncAPI v3’s decoupled structure with amessages
container under channels and a top-leveloperations
object. Well aligned with the spec.
@@ -9,7 +9,7 @@ Suppose you can only sleep when the AC in your bedroom is set to 22 °C, and you | |||
|
|||
In this tutorial: | |||
|
|||
- You'll use the [Eclipse Mosquito](https://test.mosquitto.org) **MQTT broker**, which you'll connect to subscribe and publish messages using an MQTT client. | |||
- You'll use the [Eclipse Mosquitto](https://test.mosquitto.org) **MQTT broker**, which you'll connect to subscribe and publish messages using an MQTT client. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, please update exactly what the rabbit pointed out
> 🧭 **Note on AsyncAPI v3 semantics:** | ||
> In AsyncAPI v3, the meaning of `publish` and `subscribe` has changed from v2. Now, `action: send` under the top-level `operations` object indicates that the application is publishing (i.e., sending) the message. This tutorial uses that new approach. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed, can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
There is a list of [community maintained templates](https://www.asyncapi.com/docs/tools/generator/template#generator-templates-list), but what if you do not find what you need? In that case, you'll create a user-defined template that generates custom output from the generator. | ||
Before you create the template, you'll need to have an [AsyncAPI document](https://www.asyncapi.com/docs/tools/generator/asyncapi-document) that defines the properties you want to use in your template to test against. In this tutorial, you'll use the following template saved in the **test/fixtures/asyncapi.yml** file in your template project directory. | ||
**This tutorial focuses on code generation using templates — not full AsyncAPI document modeling.** | ||
|
||
``` yml | ||
There is a list of [community maintained templates](https://www.asyncapi.com/docs/tools/generator/template#generator-templates-list), but what if you do not find what you need? In that case, you'll create a user-defined template that generates custom output from the generator. | ||
Before you create the template, you'll need an [AsyncAPI document](https://www.asyncapi.com/docs/tools/generator/asyncapi-document) that defines the properties used in your generator. | ||
In this tutorial, we use a simplified AsyncAPI document focused on extracting data for template generation. | ||
You'll use the following document saved as test/fixtures/asyncapi.yml. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why was this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes to first and foremost clarify that it doesn't fully focus on the AsyncAPI doc modeling!
just to be clear enough!
also to make the things in format, looking short to read and more understandable..
that's why i why explained the things as per lines and not as para's
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert to original
type: object | ||
additionalProperties: false | ||
properties: | ||
temperatureId: | ||
value: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, you changed it, it was temperatureId
and object had one property temperatureId
as string, now it has 2 different properties. So please revert
> 🛠️ **Note on Payload Schema Refactor:** | ||
> In this version, the payload definition has been moved to a reusable schema component (#/components/schemas/Temperature). This change reflects AsyncAPI v3 best practices, but doesn't affect functionality. This aligns with AsyncAPI v3's best practices for reuse and separation of concerns. The payload was also updated to include a unit field (e.g., °C, °F) to better reflect real-world temperature data. While this introduces a slight schema expansion, it enhances clarity for generated code consumers. The value field replaces the previous temperatureId for clearer semantics. | ||
|
||
> 🆕 This document uses the AsyncAPI 3.0.0 structure. Notable changes include `operations` now being top-level and the use of `address:` in `channels` instead of nested publish/subscribe. | ||
## Handling Diagnostics (Warnings) | ||
|
||
When using the latest AsyncAPI parser, it's important to handle not just errors, but also diagnostics (warnings). These help identify non-critical issues, such as missing recommended fields like `license`, `contact`, or outdated spec versions. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
@derberg for this mosquito thing i have reverted the changes as this opening a another PR issue as a whole! |
Also i have done the tempratureId changes |
@derberg also i really apologize for my past mistakes to take helping from AI in last few days for this issue yeah i became lazy for this issue due to sickness! srry! |
type: object | ||
additionalProperties: false | ||
properties: | ||
temperatureId: | ||
type: string | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove empty space
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now please go through this tutorial as regular users, create a template, run it with new documents and push this template to your GH account and share link and logs
@Aditya08Vashisht do you plan to continue working on this one? |
This PR rewrites the tutorial based on AsyncAPI v3 accordingly for AsyncAPI docs and code parser API usage updations.
Fixes: #1503
also i have verified it via opening the index file through the live server.. But didn't pasted these files as we have to skip only to the template updations only.
Summary by CodeRabbit