-
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
double brackets in field description causes template engine to fail #1177
Comments
That's because ReadDoc renders a go template, and You didn't use an issue template for reporting. Is this a feature request? |
yes, i have figured that out about go text/template engine. The thing is - it was counter intuitive, what has been broken. The arbitrary single go comment and swagger mailfunction is somewhat totally unrelated. In fact, swagger compiles correctly, it does not produces any errors. The error is only visible when you trying to operate WEB UI. And that error looks totally unrelated with comment. You even do not mention it to yourself that you changed something that may broke system when you typing comment. And then after some coding you run project and - bang! something happens! it does not run in browser! after 2hr of overlooking into problem (removing swagger description here and there, trying to allocate the source of the problem) i finally debugged it with delve and found the root. it's neither feature request, nor the bug. It's just a warning for someone who might lose some time by stumbling to unobvious thing. Maybe WARNING note when parsing comment with special chars could fix that. |
I will take a look later sometime at this thing. We may escape the parentheses to they would be ignored by the template engine. |
Running in to a similar issue where we have a Struct tag with
This silently broke the template parsing and took me way too long to figure out since if the As @mainpart suggested, I too propose that some kind of error or warning is added, perhaps at I'd also like to add a way to customise the Go template's delimiters using the edit: done, #1499 |
If i use {{ and }} syntax in field comments swagger fail to templatize document with neccessary variables to function.
swaggo successfully compiles docs.go but fails to template it because funcwhatever is not defined in runtime.
as a result html page become dysfunctional
swag version 1.81
The text was updated successfully, but these errors were encountered: