Skip to content

Commit e794de3

Browse files
authored
Merge pull request #468 from digital-atelier/issue-467-default-init-param-values
Fix issue 467: Add = nil to the init template in swift 4
2 parents b7992aa + f359597 commit e794de3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/resources/handlebars/swift4/modelObject.mustache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct {{classname}}: Codable {
1111
}
1212
}{{/vendorExtensions.x-swift-optional-scalar}}{{/objcCompatible}}
1313
{{/isNot}}{{/allVars}}{{#has this 'vars'}}
14-
public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#has this 'more'}}, {{/has}}{{/allVars}}) { {{#allVars}}
14+
public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}? = nil{{/required}}{{#has this 'more'}}, {{/has}}{{/allVars}}) { {{#allVars}}
1515
self.{{name}} = {{name}}{{/allVars}}
1616
}
1717
{{/has~}}{{#additionalPropertiesType}}

0 commit comments

Comments
 (0)