Skip to content

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

Description

@rogerluan

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions