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

"description" aka doc comments don't get generated nicely #294

Open
rogerluan opened this issue Jan 9, 2022 · 0 comments
Open

"description" aka doc comments don't get generated nicely #294

rogerluan opened this issue Jan 9, 2022 · 0 comments

Comments

@rogerluan
Copy link

rogerluan commented Jan 9, 2022

Hey 👋

I've found an issue where code like this:

/**
* This is a multiline
* comment.
*/
public myProperty: MyClass[];

Gets translated into this swagger json:


"myProperty": {
    "description": "* This is a multiline\n\t *  comment.",
    "items": {
        "$ref": "#/components/schemas/MyClass"
    },
    "type": "array"
},

Which SwagGen (understandably) generates this:

// * This is a multiline
 * comment.
public var myProperty: [MyClass]

Although swagger could do a bit better with providing a better generated "description" (e.g. not including the * characters), I think SwagGen should at least provide code that compiles, e.g.:

/// * This is a multiline
/// * comment.
public var myProperty: [MyClass]

In other words: using the dedicated doc comment syntax (///) and adding that delimited to the start of the line so that it's recognized as a doc comment (which makes the code compile).

Has this been considered? Or is there a better way to annotate doc comments in javascript?
All the help is highly appreciated 🙏 Thanks!

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

No branches or pull requests

1 participant