Skip to content

Commit 6d92e69

Browse files
authored
Merge pull request #471 from digital-atelier/issue-470-swift-4-multiple-enum-error
Issue 470 - swift 4 multiple enum error
2 parents 1dfd7ab + ff00e47 commit 6d92e69

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
public enum {{enumName}}: {{#isNot this 'container'}}{{datatype}}{{/isNot}}{{#is this 'container'}}String{{/is}}, Codable { {{#allowableValues}}{{#enumVars}}
22
case {{name}} = {{#is ../../this 'container'}}"{{/is}}{{#is ../../this 'string'}}"{{/is}}{{{value}}}{{#is ../../this 'string'}}"{{/is}}{{#is ../../this 'container'}}"{{/is}}{{/enumVars}}{{/allowableValues}}
3-
}
3+
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11

22
public struct {{classname}}: Codable {
33
4-
{{#allVars}}{{#is this 'enum'}}{{> modelInlineEnumDeclaration}}{{/is}}{{/allVars}}{{#allVars}}{{#is this 'enum'}} {{#description}}/** {{description}} */
4+
{{#allVars}}{{#is this 'enum'}}{{> modelInlineEnumDeclaration}}
5+
{{/is}}{{/allVars}}{{#allVars}}{{#is this 'enum'}} {{#description}}/** {{description}} */
56
{{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/is}}
67
{{#isNot this 'enum'}} {{#description}}/** {{description}} */
78
{{/description}}public var {{name}}: {{{datatype}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}}

0 commit comments

Comments
 (0)