Skip to content

Commit

Permalink
Merge pull request #961 from appwrite/fix-swift-double-optional
Browse files Browse the repository at this point in the history
Fix swift double optional
  • Loading branch information
christyjacob4 authored Aug 27, 2024
2 parents 6ee8749 + 378e607 commit 3f12532
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions templates/swift/Sources/Models/Model.swift.twig
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand All @@ -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 %}
Expand Down

0 comments on commit 3f12532

Please sign in to comment.