Skip to content

Commit b426101

Browse files
authored
Merge pull request #792 from swagger-api/Tesan3010-fix_issue10522
Tesan3010 fix issue10522
2 parents b14abd2 + ba88fb2 commit b426101

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public struct {{classname}}: Codable {
2525
{{/allVars}}
2626

2727
{{#hasVars}}
28-
public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allVars}}) {
28+
public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allVars}}) {
2929
{{#allVars}}
3030
self.{{name}} = {{name}}
3131
{{/allVars}}
@@ -84,4 +84,3 @@ public struct {{classname}}: Codable {
8484
{{/vendorExtensions.x-codegen-has-escaped-property-names}}{{/additionalPropertiesType}}
8585

8686
}
87-

0 commit comments

Comments
 (0)