From 9e3496ee717bfe0d62ac26c72a6bd9ffc9a88e3e Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Aug 2024 23:13:26 +1200 Subject: [PATCH 1/2] Fix swift double optional --- templates/swift/Sources/Models/Model.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Models/Model.swift.twig b/templates/swift/Sources/Models/Model.swift.twig index cc3fbe6be..b31f63c99 100644 --- a/templates/swift/Sources/Models/Model.swift.twig +++ b/templates/swift/Sources/Models/Model.swift.twig @@ -9,7 +9,7 @@ public class {{ definition | modelType(spec) | raw }} { {%~ for property in definition.properties %} /// {{ property.description }} - public let {{ property.name | escapeSwiftKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not property.required %}?{% endif %} + public let {{ property.name | escapeSwiftKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }} {%~ endfor %} From 378e607c719686fd3f5d6828e61b3992f587771b Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Tue, 27 Aug 2024 23:14:50 +1200 Subject: [PATCH 2/2] Fix double optional in init --- templates/swift/Sources/Models/Model.swift.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/swift/Sources/Models/Model.swift.twig b/templates/swift/Sources/Models/Model.swift.twig index b31f63c99..7b9de98b3 100644 --- a/templates/swift/Sources/Models/Model.swift.twig +++ b/templates/swift/Sources/Models/Model.swift.twig @@ -20,7 +20,7 @@ public class {{ definition | modelType(spec) | raw }} { init( {%~ for property in definition.properties %} - {{ property.name | escapeSwiftKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not property.required %}?{% endif %}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} + {{ property.name | escapeSwiftKeyword | removeDollarSign }}: {{ property | propertyType(spec) | raw }}{% if not loop.last or (loop.last and definition.additionalProperties) %},{% endif %} {%~ endfor %} {%~ if definition.additionalProperties %}