-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Problem with custom delimiters migration #33
Comments
The solution needs to be documented here: https://github.com/swagger-api/swagger-codegen/wiki/Swagger-Codegen-migration-from-Mustache-and-Handlebars-templates.#custom-delimiters |
I do not know how handlebars works, but maybe it is possible to use a constant referenced somewhere:
|
we can also add a new helper class to that and dealing the issue from java code. wdyt @jmini ? |
I am fine with any solution. I do not know mustache or handlebars well enough in order to have a meaningfull opinion. I would apreciate if you could prepare the necessary infrastrure (or provide a detailed explanation on how helper class works). |
@jmini i added a new helper to address this, can you please check if it works as expected? in your last example you just need to use: |
This works as expected! Thank you. I could migrate the Wiki page will be updated with the solution. |
In Mustache, it was possible to set custom delimiters. Example (source):
Explanation:
{{
and}}
are used.<%
and%>
should be used instead of{{
and}}
.{{
and}}
should be set instead of<%
and%>
.This do not seems to work with handlebars. This stackoverflow question propose an alternative to escape
{
and}
in handlebar:{{"{"}}
and{{"}"}}
.Example in swagger templates (example from
/modules/swagger-codegen/src/main/htmlDocs2/sample_js.mustache
).Mustache:
But this does'nt work with handlebar java:
The text was updated successfully, but these errors were encountered: