We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5da020a commit 9fe113bCopy full SHA for 9fe113b
templates/swift/Sources/Models/Model.swift.twig
@@ -20,7 +20,7 @@ public class {{ definition | modelType(spec) | raw }} {
20
21
init(
22
{%~ 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 %}
+ {{ property.name | escapeSwiftKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not property.required %}?{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %}
24
25
{%~ endfor %}
26
{%~ if definition.additionalProperties %}
0 commit comments