Skip to content

Commit 9fe113b

Browse files
committed
Revert "Fix double optional in init"
This reverts commit 378e607.
1 parent 5da020a commit 9fe113b

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
@@ -20,7 +20,7 @@ public class {{ definition | modelType(spec) | raw }} {
2020

2121
init(
2222
{%~ for property in definition.properties %}
23-
{{ property.name | escapeSwiftKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %}
23+
{{ property.name | escapeSwiftKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not property.required %}?{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %}
2424

2525
{%~ endfor %}
2626
{%~ if definition.additionalProperties %}

0 commit comments

Comments
 (0)