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

Operation description gets appended to general info if they share the same file #340

Closed
umanovskis opened this issue Mar 22, 2019 · 2 comments
Labels

Comments

@umanovskis
Copy link
Contributor

umanovskis commented Mar 22, 2019

Summary

Swag version 1.4.1.

If general API info is in the same file as operations, then the @description tag of operations will also get appended to the general info. I think this was introduced after adding support for multiline @description in the general API.

Example

Code in the same file:

// @title       Test API
// @version     0.1
// @description General API description

// @Summary Returns true
// @Description Always returns true, really
// @Success 200
// @Router /test [get]
func op() bool {
        return true
}

After swag init, it will generate this description for the general API:

"description": "General API description\nAlways returns true, really",

And the operation's description itself will be correct:

 "description": "Always returns true, really",
@pei0804
Copy link
Member

pei0804 commented Mar 23, 2019

Thank you!
I will review your code.

@pei0804 pei0804 added the bug label Mar 23, 2019
easonlin404 pushed a commit that referenced this issue Mar 23, 2019
@umanovskis
Copy link
Contributor Author

PR has been merged - thanks to the maintainers.

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

No branches or pull requests

2 participants