Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(generator): update latest generator documentation #3573

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions markdown/docs/tools/generator/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ Reference API documentation for AsyncAPI Generator library.
* [.executeAfterHook()](#Generator+executeAfterHook) ⇒ `Promise.<void>`
* [.parseInput()](#Generator+parseInput)
* [.configureTemplate()](#Generator+configureTemplate)
* ~~[.generateFromString(asyncapiString, [parseOptions])](#Generator+generateFromString) ⇒ `Promise`~~
* [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise`
* [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise`
* ~~[.generateFromString(asyncapiString, [parseOptions])](#Generator+generateFromString) ⇒ `Promise.<(TemplateRenderResult|undefined)>`~~
* [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise.<(TemplateRenderResult|undefined)>`
* [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise.<(TemplateRenderResult|undefined)>`
Comment on lines +43 to +44
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Document cases where methods return undefined.

The return types for generateFromURL and generateFromFile now include undefined as a possible return value, but there's no documentation explaining under what conditions this occurs.

Consider adding documentation like this:

- [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise.<(TemplateRenderResult|undefined)>`
+ [.generateFromURL(asyncapiURL)](#Generator+generateFromURL) ⇒ `Promise.<(TemplateRenderResult|undefined)>` - Returns undefined when [specify condition]

- [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise.<(TemplateRenderResult|undefined)>`
+ [.generateFromFile(asyncapiFile)](#Generator+generateFromFile) ⇒ `Promise.<(TemplateRenderResult|undefined)>` - Returns undefined when [specify condition]

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Markdownlint (0.37.0)

43-43: Expected: 4; Actual: 8
Unordered list indentation

(MD007, ul-indent)


44-44: Expected: 4; Actual: 8
Unordered list indentation

(MD007, ul-indent)

* [.installTemplate([force])](#Generator+installTemplate)
* _static_
* [.getTemplateFile(templateName, filePath, [templatesDir])](#Generator.getTemplateFile) ⇒ `Promise`
Expand Down
2 changes: 1 addition & 1 deletion markdown/docs/tools/generator/installation-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ To uninstall the generator, use the following command:
npm uninstall @asyncapi/cli -g
```

> :memo: **Note:** To use the generator in your CI/CD pipeline to automate whatever you generate for your event-driven architecture apps, install the AsyncAPI CLI in your pipeline. If you are using GitHub Actions, use [Github Actions for Generator](https://github.com/marketplace/actions/generator-validator-converter-and-others-all-in-one-for-your-asyncapi-docs).
> :memo: **Note:** To use the generator in your CI/CD pipeline to automate whatever you generate for your event-driven architecture apps, install the AsyncAPI CLI in your pipeline. If you are using GitHub Actions, use [Github Actions for Generator](https://github.com/marketplace/actions/generator-for-asyncapi-documents).

## Generator library in Node.js apps
Use the generator library in your Node.js projects by installing it via the following command: `npm install @asyncapi/generator`.
Expand Down
Loading