Skip to content

feat: ParseComment error to contain the comment - #1777

Merged
ubogdan merged 1 commit into
swaggo:masterfrom
stokito:parse_comment
Oct 21, 2024
Merged

ubogdan merged 1 commit into
swaggo:masterfrom
stokito:parse_comment

Conversation

@stokito

@stokito stokito commented Mar 20, 2024 •

Copy link
Copy Markdown
Contributor

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

ubogdan commented Oct 20, 2024

Copy link
Copy Markdown
Contributor

@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

stokito commented Oct 21, 2024

Copy link
Copy Markdown
Contributor Author

rebased

@ubogdan ubogdan left a comment

Copy link
Copy Markdown
Contributor

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
@ubogdan

ubogdan commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

@stokito Thanks for your contribution!

@stokito
stokito deleted the parse_comment branch October 21, 2024 23:40
Thiht pushed a commit to Thiht/swag that referenced this pull request Feb 28, 2025
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.
stronger24 pushed a commit to stronger24/swag that referenced this pull request Jul 25, 2025
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.
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

⌂ 换网址