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

Renaming of models #1789

Open
aurelius15 opened this issue Apr 12, 2024 · 1 comment
Open

Renaming of models #1789

aurelius15 opened this issue Apr 12, 2024 · 1 comment

Comments

@aurelius15
Copy link

aurelius15 commented Apr 12, 2024

Hello,

Could someone help me understand why annotations are added to rename the model at the end of the structure? From my point of view, it would be more consistent if we had it at the top of the structure.

https://github.com/swaggo/swag?tab=readme-ov-file#rename-model-to-display

From

type Resp struct {
	Code int
}//@name Response

To

// Resp - some info...
// @name MyAwesomeResponse
type Resp struct {
	Code int
}
@sdghchj
Copy link
Member

sdghchj commented Apr 22, 2024

As you known, the comments at the top of a function is taken as the doc element, so does goparser.
But, it is a pity that goparser does not take the comments on the top of the type as its doc element.
That is to say, in the eyes of goparser, the comments above a type definition have nothing to do with the type.

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

2 participants