diff --git a/templates/cli/lib/type-generation/languages/csharp.js.twig b/templates/cli/lib/type-generation/languages/csharp.js.twig index 1df7c7cdb..3914d1595 100644 --- a/templates/cli/lib/type-generation/languages/csharp.js.twig +++ b/templates/cli/lib/type-generation/languages/csharp.js.twig @@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute'); const { LanguageMeta } = require("./language"); class CSharp extends LanguageMeta { - getType(attribute, collections) { + getType(attribute, collections, collectionName) { let type = ""; switch (attribute.type) { case AttributeType.STRING: @@ -11,7 +11,7 @@ class CSharp extends LanguageMeta { case AttributeType.DATETIME: type = "string"; if (attribute.format === AttributeType.ENUM) { - type = LanguageMeta.toPascalCase(attribute.key); + type = LanguageMeta.toPascalCase(collectionName) + LanguageMeta.toPascalCase(attribute.key); } break; case AttributeType.INTEGER: @@ -60,7 +60,7 @@ namespace Appwrite.Models <% for (const attribute of collection.attributes) { -%> <% if (attribute.format === 'enum') { -%> -public enum <%- toPascalCase(attribute.key) %> { +public enum <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %> { <% for (const [index, element] of Object.entries(attribute.elements) ) { -%> [JsonPropertyName("<%- element %>")] <%- toPascalCase(element) %><% if (index < attribute.elements.length - 1) { %>,<% } %> @@ -72,13 +72,13 @@ public class <%= toPascalCase(collection.name) %> { <% for (const [index, attribute] of Object.entries(collection.attributes)) { -%> [JsonPropertyName("<%- attribute.key %>")] - public <%- getType(attribute, collections) %> <%= toPascalCase(attribute.key) %> { get; private set; } + public <%- getType(attribute, collections, collection.name) %> <%= toPascalCase(attribute.key) %> { get; private set; } <% } -%> public <%= toPascalCase(collection.name) %>( <% for (const [index, attribute] of Object.entries(collection.attributes)) { -%> - <%- getType(attribute, collections) %> <%= toCamelCase(attribute.key) %><% if (index < collection.attributes.length - 1) { %>,<% } %> + <%- getType(attribute, collections, collection.name) %> <%= toCamelCase(attribute.key) %><% if (index < collection.attributes.length - 1) { %>,<% } %> <% } -%> ) { @@ -93,9 +93,9 @@ public class <%= toPascalCase(collection.name) %> // ENUM if (attribute.format === 'enum') { if (attribute.array) { - -%>((IEnumerable)map["<%- attribute.key %>"]).Select(e => Enum.Parse>(e.ToString()!, true)).ToList()<% + -%>((IEnumerable)map["<%- attribute.key %>"]).Select(e => Enum.Parse<%- toPascalCase(attribute.key) %>>(e.ToString()!, true)).ToList()<% } else { - -%>Enum.Parse>(map["<%- attribute.key %>"].ToString()!, true)<% + -%>Enum.Parse<%- toPascalCase(attribute.key) %>>(map["<%- attribute.key %>"].ToString()!, true)<% } // RELATIONSHIP } else if (attribute.type === 'relationship') { @@ -122,7 +122,7 @@ public class <%= toPascalCase(collection.name) %> } else if (attribute.type === 'double') { -%><%- !attribute.required ? 'map["' + attribute.key + '"] == null ? null : ' : '' %>Convert.ToDouble(map["<%- attribute.key %>"])<% } else if (attribute.type === 'boolean') { - -%>(<%- getType(attribute, collections) %>)map["<%- attribute.key %>"]<% + -%>(<%- getType(attribute, collections, collection.name) %>)map["<%- attribute.key %>"]<% } else if (attribute.type === 'string' || attribute.type === 'datetime' || attribute.type === 'email') { -%>map["<%- attribute.key %>"]<%- !attribute.required ? '?' : '' %>.ToString()<%- attribute.required ? '!' : ''%><% } else { diff --git a/templates/cli/lib/type-generation/languages/dart.js.twig b/templates/cli/lib/type-generation/languages/dart.js.twig index 73ea972a4..d44efb932 100644 --- a/templates/cli/lib/type-generation/languages/dart.js.twig +++ b/templates/cli/lib/type-generation/languages/dart.js.twig @@ -40,7 +40,7 @@ class Dart extends LanguageMeta { return 'appwrite'; } - getType(attribute, collections) { + getType(attribute, collections, collectionName) { let type = ""; switch (attribute.type) { case AttributeType.STRING: @@ -48,7 +48,7 @@ class Dart extends LanguageMeta { case AttributeType.DATETIME: type = "String"; if (attribute.format === AttributeType.ENUM) { - type = LanguageMeta.toPascalCase(attribute.key); + type = LanguageMeta.toPascalCase(collectionName) + LanguageMeta.toPascalCase(attribute.key); } break; case AttributeType.INTEGER: @@ -103,7 +103,7 @@ import '<%- toSnakeCase(related.name) %>.dart'; <% for (const attribute of __attrs) { -%> <% if (attribute.format === '${AttributeType.ENUM}') { -%> -enum <%- toPascalCase(attribute.key) %> { +enum <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %> { <% for (const [index, element] of Object.entries(attribute.elements)) { -%> <%- strict ? toCamelCase(element) : element %><% if (index < attribute.elements.length - 1) { -%>,<% } %> <% } -%> @@ -113,7 +113,7 @@ enum <%- toPascalCase(attribute.key) %> { <% } -%> class <%= toPascalCase(collection.name) %> { <% for (const [index, attribute] of Object.entries(__attrs)) { -%> - <%- getType(attribute, collections) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>; + <%- getType(attribute, collections, collection.name) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>; <% } -%> <%= toPascalCase(collection.name) %>({ @@ -128,10 +128,10 @@ class <%= toPascalCase(collection.name) %> { <%= strict ? toCamelCase(attribute.key) : attribute.key %>: <% if (attribute.type === '${AttributeType.STRING}' || attribute.type === '${AttributeType.EMAIL}' || attribute.type === '${AttributeType.DATETIME}') { -%> <% if (attribute.format === '${AttributeType.ENUM}') { -%> <% if (attribute.array) { -%> -(map['<%= attribute.key %>'] as List?)?.map((e) => <%- toPascalCase(attribute.key) %>.values.firstWhere((element) => element.name == e)).toList()<% } else { -%> +(map['<%= attribute.key %>'] as List?)?.map((e) => <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %>.values.firstWhere((element) => element.name == e)).toList()<% } else { -%> <% if (!attribute.required) { -%> -map['<%= attribute.key %>'] != null ? <%- toPascalCase(attribute.key) %>.values.where((e) => e.name == map['<%= attribute.key %>']).firstOrNull : null<% } else { -%> -<%- toPascalCase(attribute.key) %>.values.firstWhere((e) => e.name == map['<%= attribute.key %>'])<% } -%> +map['<%= attribute.key %>'] != null ? <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %>.values.where((e) => e.name == map['<%= attribute.key %>']).firstOrNull : null<% } else { -%> +<%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %>.values.firstWhere((e) => e.name == map['<%= attribute.key %>'])<% } -%> <% } -%> <% } else { -%> <% if (attribute.array) { -%> diff --git a/templates/cli/lib/type-generation/languages/java.js.twig b/templates/cli/lib/type-generation/languages/java.js.twig index 9ab86a82c..dfcf5e20b 100644 --- a/templates/cli/lib/type-generation/languages/java.js.twig +++ b/templates/cli/lib/type-generation/languages/java.js.twig @@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute'); const { LanguageMeta } = require("./language"); class Java extends LanguageMeta { - getType(attribute, collections) { + getType(attribute, collections, collectionName) { let type = ""; switch (attribute.type) { case AttributeType.STRING: @@ -11,7 +11,7 @@ class Java extends LanguageMeta { case AttributeType.DATETIME: type = "String"; if (attribute.format === AttributeType.ENUM) { - type = LanguageMeta.toPascalCase(attribute.key); + type = LanguageMeta.toPascalCase(collectionName) + LanguageMeta.toPascalCase(attribute.key); } break; case AttributeType.INTEGER: @@ -61,7 +61,7 @@ public class <%- toPascalCase(collection.name) %> { <% for (const attribute of collection.attributes) { -%> <% if (attribute.format === 'enum') { -%> - public enum <%- toPascalCase(attribute.key) %> { + public enum <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %> { <% for (const [index, element] of Object.entries(attribute.elements)) { -%> <%- strict ? toUpperSnakeCase(element) : element %><%- index < attribute.elements.length - 1 ? ',' : ';' %> <% } -%> @@ -70,7 +70,7 @@ public class <%- toPascalCase(collection.name) %> { <% } -%> <% } -%> <% for (const attribute of collection.attributes) { -%> - private <%- getType(attribute, collections) %> <%- strict ? toCamelCase(attribute.key) : attribute.key %>; + private <%- getType(attribute, collections, collection.name) %> <%- strict ? toCamelCase(attribute.key) : attribute.key %>; <% } -%> public <%- toPascalCase(collection.name) %>() { @@ -78,7 +78,7 @@ public class <%- toPascalCase(collection.name) %> { public <%- toPascalCase(collection.name) %>( <% for (const [index, attribute] of Object.entries(collection.attributes)) { -%> - <%- getType(attribute, collections) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %><%- index < collection.attributes.length - 1 ? ',' : '' %> + <%- getType(attribute, collections, collection.name) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %><%- index < collection.attributes.length - 1 ? ',' : '' %> <% } -%> ) { <% for (const attribute of collection.attributes) { -%> @@ -87,11 +87,11 @@ public class <%- toPascalCase(collection.name) %> { } <% for (const attribute of collection.attributes) { -%> - public <%- getType(attribute, collections) %> get<%- toPascalCase(attribute.key) %>() { + public <%- getType(attribute, collections, collection.name) %> get<%- toPascalCase(attribute.key) %>() { return <%= strict ? toCamelCase(attribute.key) : attribute.key %>; } - public void set<%- toPascalCase(attribute.key) %>(<%- getType(attribute, collections) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>) { + public void set<%- toPascalCase(attribute.key) %>(<%- getType(attribute, collections, collection.name) %> <%= strict ? toCamelCase(attribute.key) : attribute.key %>) { this.<%= strict ? toCamelCase(attribute.key) : attribute.key %> = <%= strict ? toCamelCase(attribute.key) : attribute.key %>; } diff --git a/templates/cli/lib/type-generation/languages/kotlin.js.twig b/templates/cli/lib/type-generation/languages/kotlin.js.twig index 2c377174f..09df341a0 100644 --- a/templates/cli/lib/type-generation/languages/kotlin.js.twig +++ b/templates/cli/lib/type-generation/languages/kotlin.js.twig @@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute'); const { LanguageMeta } = require("./language"); class Kotlin extends LanguageMeta { - getType(attribute, collections) { + getType(attribute, collections, collectionName) { let type = ""; switch (attribute.type) { case AttributeType.STRING: @@ -11,7 +11,7 @@ class Kotlin extends LanguageMeta { case AttributeType.DATETIME: type = "String"; if (attribute.format === AttributeType.ENUM) { - type = LanguageMeta.toPascalCase(attribute.key); + type = LanguageMeta.toPascalCase(collectionName) + LanguageMeta.toPascalCase(attribute.key); } break; case AttributeType.INTEGER: @@ -61,7 +61,7 @@ import <%- toPascalCase(collections.find(c => c.$id === attribute.relatedCollect <% for (const attribute of collection.attributes) { -%> <% if (attribute.format === 'enum') { -%> -enum class <%- toPascalCase(attribute.key) %> { +enum class <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %> { <% for (const [index, element] of Object.entries(attribute.elements)) { -%> <%- strict ? toUpperSnakeCase(element) : element %><%- index < attribute.elements.length - 1 ? ',' : '' %> <% } -%> @@ -71,7 +71,7 @@ enum class <%- toPascalCase(attribute.key) %> { <% } -%> data class <%- toPascalCase(collection.name) %>( <% for (const [index, attribute] of Object.entries(collection.attributes)) { -%> - val <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections) %><% if (index < collection.attributes.length - 1) { %>,<% } %> + val <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections, collection.name) %><% if (index < collection.attributes.length - 1) { %>,<% } %> <% } -%> ) `; diff --git a/templates/cli/lib/type-generation/languages/php.js.twig b/templates/cli/lib/type-generation/languages/php.js.twig index 942b585e3..713ed2004 100644 --- a/templates/cli/lib/type-generation/languages/php.js.twig +++ b/templates/cli/lib/type-generation/languages/php.js.twig @@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute'); const { LanguageMeta } = require("./language"); class PHP extends LanguageMeta { - getType(attribute, collections) { + getType(attribute, collections, collectionName) { if (attribute.array) { return "array"; } @@ -14,7 +14,7 @@ class PHP extends LanguageMeta { case AttributeType.DATETIME: type = "string"; if (attribute.format === AttributeType.ENUM) { - type = LanguageMeta.toPascalCase(attribute.key); + type = LanguageMeta.toPascalCase(collectionName) + LanguageMeta.toPascalCase(attribute.key); } break; case AttributeType.INTEGER: @@ -60,9 +60,9 @@ use Appwrite\\Models\\<%- toPascalCase(collections.find(c => c.$id === attribute <% } -%> <% for (const attribute of collection.attributes) { -%> <% if (attribute.format === 'enum') { -%> -enum <%- toPascalCase(attribute.key) %>: string { +enum <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %>: string { <% for (const [index, element] of Object.entries(attribute.elements)) { -%> - case <%- strict ? toUpperSnakeCase(element) : element %> = '<%- element %>'; + case <%- toUpperSnakeCase(element) %> = '<%- element %>'; <% } -%> } @@ -70,15 +70,15 @@ enum <%- toPascalCase(attribute.key) %>: string { <% } -%> class <%- toPascalCase(collection.name) %> { <% for (const attribute of collection.attributes ){ -%> - private <%- getType(attribute, collections) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>; + private <%- getType(attribute, collections, collection.name) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>; <% } -%> public function __construct( <% for (const attribute of collection.attributes ){ -%> <% if (attribute.required) { -%> - <%- getType(attribute, collections).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %><% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %> + <%- getType(attribute, collections, collection.name).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %><% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %> <% } else { -%> - ?<%- getType(attribute, collections).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %> = null<% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %> + ?<%- getType(attribute, collections, collection.name).replace('|null', '') %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %> = null<% if (collection.attributes.indexOf(attribute) < collection.attributes.length - 1) { %>,<% } %> <% } -%> <% } -%> ) { @@ -88,11 +88,11 @@ class <%- toPascalCase(collection.name) %> { } <% for (const [index, attribute] of Object.entries(collection.attributes)) { -%> - public function get<%- toPascalCase(attribute.key) %>(): <%- getType(attribute, collections) %> { + public function get<%- toPascalCase(attribute.key) %>(): <%- getType(attribute, collections, collection.name) %> { return $this-><%- strict ? toCamelCase(attribute.key) : attribute.key %>; } - public function set<%- toPascalCase(attribute.key) %>(<%- getType(attribute, collections) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>): void { + public function set<%- toPascalCase(attribute.key) %>(<%- getType(attribute, collections, collection.name) %> $<%- strict ? toCamelCase(attribute.key) : attribute.key %>): void { $this-><%- strict ? toCamelCase(attribute.key) : attribute.key %> = $<%- strict ? toCamelCase(attribute.key) : attribute.key %>; } <% if (index < collection.attributes.length - 1) { %> diff --git a/templates/cli/lib/type-generation/languages/swift.js.twig b/templates/cli/lib/type-generation/languages/swift.js.twig index 4322404ec..87557bb32 100644 --- a/templates/cli/lib/type-generation/languages/swift.js.twig +++ b/templates/cli/lib/type-generation/languages/swift.js.twig @@ -3,7 +3,7 @@ const { AttributeType } = require('../attribute'); const { LanguageMeta } = require("./language"); class Swift extends LanguageMeta { - getType(attribute, collections) { + getType(attribute, collections, collectionName) { let type = ""; switch (attribute.type) { case AttributeType.STRING: @@ -11,7 +11,7 @@ class Swift extends LanguageMeta { case AttributeType.DATETIME: type = "String"; if (attribute.format === AttributeType.ENUM) { - type = LanguageMeta.toPascalCase(attribute.key); + type = LanguageMeta.toPascalCase(collectionName) + LanguageMeta.toPascalCase(attribute.key); } break; case AttributeType.INTEGER: @@ -53,7 +53,7 @@ class Swift extends LanguageMeta { <% for (const attribute of collection.attributes) { -%> <% if (attribute.format === 'enum') { -%> -public enum <%- toPascalCase(attribute.key) %>: String, Codable, CaseIterable { +public enum <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %>: String, Codable, CaseIterable { <% for (const [index, element] of Object.entries(attribute.elements)) { -%> case <%- strict ? toCamelCase(element) : element %> = "<%- element %>" <% } -%> @@ -63,7 +63,7 @@ public enum <%- toPascalCase(attribute.key) %>: String, Codable, CaseIterable { <% } -%> public class <%- toPascalCase(collection.name) %>: Codable { <% for (const attribute of collection.attributes) { -%> - public let <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections) %> + public let <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections, collection.name) %> <% } %> enum CodingKeys: String, CodingKey { <% for (const attribute of collection.attributes) { -%> @@ -73,7 +73,7 @@ public class <%- toPascalCase(collection.name) %>: Codable { public init( <% for (const [index, attribute] of Object.entries(collection.attributes)) { -%> - <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections) %><% if (index < collection.attributes.length - 1) { %>,<% } %> + <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- getType(attribute, collections, collection.name) %><% if (index < collection.attributes.length - 1) { %>,<% } %> <% } -%> ) { <% for (const attribute of collection.attributes) { -%> @@ -86,9 +86,9 @@ public class <%- toPascalCase(collection.name) %>: Codable { <% for (const attribute of collection.attributes) { -%> <% if (!(!attribute.required && attribute.default === null)) { -%> - self.<%- strict ? toCamelCase(attribute.key) : attribute.key %> = try container.decode(<%- getType(attribute, collections).replace('?', '') %>.self, forKey: .<%- strict ? toCamelCase(attribute.key) : attribute.key %>) + self.<%- strict ? toCamelCase(attribute.key) : attribute.key %> = try container.decode(<%- getType(attribute, collections, collection.name).replace('?', '') %>.self, forKey: .<%- strict ? toCamelCase(attribute.key) : attribute.key %>) <% } else { -%> - self.<%- strict ? toCamelCase(attribute.key) : attribute.key %> = try container.decodeIfPresent(<%- getType(attribute, collections).replace('?', '') %>.self, forKey: .<%- strict ? toCamelCase(attribute.key) : attribute.key %>) + self.<%- strict ? toCamelCase(attribute.key) : attribute.key %> = try container.decodeIfPresent(<%- getType(attribute, collections, collection.name).replace('?', '') %>.self, forKey: .<%- strict ? toCamelCase(attribute.key) : attribute.key %>) <% } -%> <% } -%> } @@ -144,7 +144,7 @@ public class <%- toPascalCase(collection.name) %>: Codable { <% if ((attribute.type === 'string' || attribute.type === 'email' || attribute.type === 'datetime') && attribute.format !== 'enum') { -%> <%- strict ? toCamelCase(attribute.key) : attribute.key %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> String<% if (index < collection.attributes.length - 1) { %>,<% } %> <% } else if (attribute.type === 'string' && attribute.format === 'enum') { -%> - <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- toPascalCase(attribute.key) %>(rawValue: map["<%- attribute.key %>"] as! String)!<% if (index < collection.attributes.length - 1) { %>,<% } %> + <%- strict ? toCamelCase(attribute.key) : attribute.key %>: <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %>(rawValue: map["<%- attribute.key %>"] as! String)!<% if (index < collection.attributes.length - 1) { %>,<% } %> <% } else if (attribute.type === 'integer') { -%> <%- strict ? toCamelCase(attribute.key) : attribute.key %>: map["<%- attribute.key %>"] as<% if (!attribute.required) { %>?<% } else { %>!<% } %> Int<% if (index < collection.attributes.length - 1) { %>,<% } %> <% } else if (attribute.type === 'float') { -%> diff --git a/templates/cli/lib/type-generation/languages/typescript.js.twig b/templates/cli/lib/type-generation/languages/typescript.js.twig index c5bd044bc..61a6fcb0b 100644 --- a/templates/cli/lib/type-generation/languages/typescript.js.twig +++ b/templates/cli/lib/type-generation/languages/typescript.js.twig @@ -6,7 +6,7 @@ const { AttributeType } = require('../attribute'); const { LanguageMeta } = require("./language"); class TypeScript extends LanguageMeta { - getType(attribute, collections) { + getType(attribute, collections, collectionName) { let type = "" switch (attribute.type) { case AttributeType.STRING: @@ -16,7 +16,7 @@ class TypeScript extends LanguageMeta { case AttributeType.URL: type = "string"; if (attribute.format === AttributeType.ENUM) { - type = LanguageMeta.toPascalCase(attribute.key); + type = LanguageMeta.toPascalCase(collectionName) + LanguageMeta.toPascalCase(attribute.key); } break; case AttributeType.INTEGER: @@ -77,7 +77,7 @@ class TypeScript extends LanguageMeta { <% for (const collection of collections) { -%> <% for (const attribute of collection.attributes) { -%> <% if (attribute.format === 'enum') { -%> -export enum <%- toPascalCase(attribute.key) %> { +export enum <%- toPascalCase(collection.name) %><%- toPascalCase(attribute.key) %> { <% const entries = Object.entries(attribute.elements); -%> <% for (let i = 0; i < entries.length; i++) { -%> <%- toUpperSnakeCase(entries[i][1]) %> = "<%- entries[i][1] %>"<% if (i !== entries.length - 1) { %>,<% } %> @@ -92,7 +92,7 @@ export type <%- toPascalCase(collection.name) %> = Models.Row & { <% for (const attribute of collection.attributes) { -%> <% const propertyName = strict ? toCamelCase(attribute.key) : attribute.key; -%> <% const isValidIdentifier = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(propertyName); -%> - <% if (isValidIdentifier) { %><%- propertyName %><% } else { %>"<%- propertyName %>"<% } %>: <%- getType(attribute, collections) %>; + <% if (isValidIdentifier) { %><%- propertyName %><% } else { %>"<%- propertyName %>"<% } %>: <%- getType(attribute, collections, collection.name) %>; <% } -%> }<% if (index < collections.length - 1) { %> <% } %>