I am new to Swift and I was working using SwagGen which generated Swift code from Swagger Style Json object. For generating code they have template files. I saw a wierd syntax for auto-generation in those files
public init({% if bodyParam %}_ {{ bodyParam.name}}: {{ bodyParam.optionalType }}{% if nonBodyParams %}, {% endif %}{% endif %}{% if nonBodyParams %}_ options: Options{% endif %}) {
{% if bodyParam %}
self.{{ bodyParam.name}} = {{ bodyParam.name}}
{% endif %}
{% if nonBodyParams %}
self.options = options
{% endif %}
super.init(service: {{ operationId|upperCamelCase }}.service)
}
What is this syntax({{% %}})? I have to make changes in this code for my personal purposes. Can any one suggest some links to learn this or explain what it is?
Swagger uses .mustache files as template files. You should have a look at the official documentation of moustache if you don't understand its syntax.