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

feat: ParseComment error to contain the comment #1777

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

stokito
Copy link
Contributor

@stokito stokito commented Mar 20, 2024

When a comment has an error then we print only a file name and the error text but not the comment that caused an error. To make it easier to understand print it.

Context:
I spent a lot of time while investigating the error message:

Generating dto.DeleteRequest
Key is not supported paramType

It turned out that the DTO was fine but a problem was in another place with a comment:

// @Param User Key body dto.UserRequest true "Event"

In the comment instead of UserKey it was written User Key and the Key was threatened as a paramType. I wasn't able to figure out which key they are talking about.

So the change should significantly improve troubleshooting which is important.

sdghchj
sdghchj previously approved these changes Mar 21, 2024
@ubogdan
Copy link
Contributor

ubogdan commented Oct 20, 2024

@stokito can you please fix the conflicts.

When a comment has an error then we print only a file name and the error text but not the comment that caused an error.
To make it easier to understand a problem print it.

Also change an error itself to make it easier to google.
@stokito
Copy link
Contributor Author

stokito commented Oct 21, 2024

rebased

Copy link
Contributor

@ubogdan ubogdan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ubogdan ubogdan merged commit b506fa6 into swaggo:master Oct 21, 2024
10 checks passed
@ubogdan
Copy link
Contributor

ubogdan commented Oct 21, 2024

@stokito Thanks for your contribution!

@stokito stokito deleted the parse_comment branch October 21, 2024 23:40
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

Successfully merging this pull request may close these issues.

3 participants