Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Docs Bug 🐞 report]: templateParams should be an object instead of string in the JSDoc #985

Closed
1 task done
imballinst opened this issue Jun 8, 2023 · 2 comments · Fixed by #999
Closed
1 task done

Comments

@imballinst
Copy link
Contributor

Describe the bug you found in AsyncAPI Docs.

Hello!

I want to propose line change from this:

* @param {String} [options.templateParams] Optional parameters to pass to the template. Each template define their own params.

to this:

   * @param {Object} [options.templateParams]   Optional parameters to pass to the template. Each template define their own params.

Reason being is, in the constructor body, templateParams is going to be used for Object.keys. If string is used with Object.keys, it will result in the character indices instead.

> Object.keys("{}")
Array [ "0", "1" ]

I can help create a pull request, if this issue is indeed valid. Let me know if I need to provide more information. Thanks!

Attach any resources that can help us understand the issue.

image

This contradicts with this line:

Object.keys(templateParams).forEach(key => {

Code of Conduct

  • I agree to follow this project's Code of Conduct
@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2023

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@derberg
Copy link
Member

derberg commented Jun 27, 2023

@imballinst you are totally right, can you please open up a PR 🙏🏼

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