-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Parsing of @Success and @Failure comments is buggy #941
Comments
I am also facing this issue |
Same issue~ |
Looking at the code the format is not supported: Line 727 in 17c1766
It needs to be 5 sections in total divided by spaces @Failure 500 {schemaType} refType responseDescription
I would however agree that there needs to be a way to define an empty response in certain cases, too. |
I am also facing this issue when trying to update the docs... |
Hey guys, Is there anyone reading that stupid documentation? This is an invalid definition:
A working example can be found here. if you need to add a "description" about why the error is happening this can be done as the following example. Hope that was helpful. |
I'm facing the same issue on responses that don't contain a response body. From the Swagger docs:
The examples given would set a type field on the response, which wouldn't be correct. |
Is anyone open to write an implementation? |
@ubogdan, would you accept supporting it as |
I feel this definition may be more intuitive for a GO developer
I especially prefer nil (go like) instead of null (javascript like). |
The feature was implemented and will be released in v1.7.2. |
Describe the bug
There is something wrong with the parsing of @success and @failure particularly of their comment fields when there aren't any
{param type}
anddata type
fields. Example:// @Failure 500 "Internal Server Error
If there are only numbers in the comment it can be arbitrarily long. Still when the comment is "Internal Server Error"
swag init
gives me an error saying:ParseComment error in file placeholder/placeholder.go :can not parse response comment "500 "Internal Server Error""
Your swag version
1.7.0
Your go version
1.15.7
Desktop:
The text was updated successfully, but these errors were encountered: