Skip to content

Commit 04ac286

Browse files
committed
Fix swift toMap inner escaping
1 parent 79e6c04 commit 04ac286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates/swift/Sources/Models/Model.swift.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ open class {{ definition | modelType(spec) | raw }}: Codable {
6969
public func toMap() -> [String: Any] {
7070
return [
7171
{%~ for property in definition.properties %}
72-
"{{ property.name | escapeSwiftKeyword }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeSwiftKeyword | removeDollarSign}}.map { $0.toMap() }{% else %}{{property.name | escapeSwiftKeyword | removeDollarSign}}.toMap(){% endif %}{% else %}{{property.name | escapeSwiftKeyword | removeDollarSign}}{% endif %} as Any{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %}
72+
"{{ property.name }}": {% if property.sub_schema %}{% if property.type == 'array' %}{{property.name | escapeSwiftKeyword | removeDollarSign}}.map { $0.toMap() }{% else %}{{property.name | escapeSwiftKeyword | removeDollarSign}}.toMap(){% endif %}{% else %}{{property.name | escapeSwiftKeyword | removeDollarSign}}{% endif %} as Any{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %}
7373

7474
{%~ endfor %}
7575
{%~ if definition.additionalProperties %}

0 commit comments

Comments
 (0)