Skip to content

Commit d0148c3

Browse files
Merge pull request #545 from appwrite/fix-swift-no-param-models
Fix swift no param models
2 parents bfe58eb + 50b9428 commit d0148c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/swift/Sources/Models/Model.swift.twig

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
{% macro sub_schema(property) %}{% if property.sub_schema %}{% if property.type == 'array' %}[{{property.sub_schema | caseUcfirst}}]{% else %}{{property.sub_schema | caseUcfirst}}{% endif %}{% else %}{% if property.type == 'object' and property.additionalProperties %}[String : Any]{% else %}{{property | typeName}}{% endif %}{% endif %}{% endmacro %}
22

33
/// {{ definition.description }}
4+
{% if definition.properties | length == 0 and not definition.additionalProperties %}
5+
public class {{ definition.name | caseUcfirst }} {}
6+
{% else %}
47
public class {{ definition.name | caseUcfirst }} {
58

69
{% for property in definition.properties %}
@@ -72,4 +75,5 @@ public class {{ definition.name | caseUcfirst }} {
7275
{% endif %}
7376
{% endfor %}
7477

75-
}
78+
}
79+
{% endif %}

0 commit comments

Comments
 (0)