-
Notifications
You must be signed in to change notification settings - Fork 497
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
Enhance introspectComments to provide summary and description for routes #1097
Comments
Would you like to create a PR for this issue? |
I can have a go - are there any docs, or please could you give me a hint as to what function to look at? |
That's the method you would have to modify: https://github.com/nestjs/swagger/blob/master/lib/plugin/visitors/controller-class.visitor.ts#L88 (after |
Thanks - and are there any unit tests I can leverage? |
I would be too interested in supporting better instrospection. I usually write my comment in a TSDoc format with leading asterisks on each line, which are sadly not stripped. /**
* Public description, visible to customers.
* @example
* Summer Party
*/ Most robust solution could involve the official TSDoc parser (you can view the AST in their playground), but it seems to parse the comments down to paragraphs and newlines, the AST is far too fine grained. I would be happy to contribute, but I'm not sure, how to tackle particular problem. |
Let's track this here #1207 |
Is there any update on this? |
I'm submitting a...
Current behavior
The nest-cli swagger plugin with
introspectComments
set to true works very nicely adding descriptions to routes from comments.However, it is not yet possible to add a summary or a title to a route via a comment. Instead you have to revert to adding a decorator again which is a shame, as below.
Desired behavior
What would be nice if the comment's 1st line could represent the summary/title, and subsequent lines the description, as below. This removes the need for the
@ApiOperation
decorator.Environment
Nest version: 7.5.1
@nestjs/swagger: 4.7.6
The text was updated successfully, but these errors were encountered: