Skip to content

Commit 2bffcf2

Browse files
Merge pull request #94 from emmanueltouzery/beanpropertypath_ext_fix
bean property path extension: bug if the DTO had a field named 'name' or 'parent'
2 parents c5436cc + 7855872 commit 2bffcf2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

typescript-generator-core/src/main/java/cz/habarta/typescript/generator/ext/BeanPropertyPathExtension.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,17 @@ public void emitElements(Writer writer, Settings settings, boolean exportKeyword
5151
private static void emitFieldsClass(Writer writer, Settings settings) {
5252
List<String> fieldsClassLines = Arrays.asList(
5353
"class Fields {",
54-
" protected parent: Fields | undefined;",
55-
" protected name: string | undefined;",
54+
" protected $$parent: Fields | undefined;",
55+
" protected $$name: string | undefined;",
5656
" constructor(parent?: Fields, name?: string) {",
57-
" this.parent = parent;",
58-
" this.name = name;",
57+
" this.$$parent = parent;",
58+
" this.$$name = name;",
5959
" };",
6060
" get(): string | undefined {",
61-
" if (this.parent && this.parent.get()) {",
62-
" return this.name ? this.parent.get() + \".\" + this.name : this.parent.get();",
61+
" if (this.$$parent && this.$$parent.get()) {",
62+
" return this.$$name ? this.$$parent.get() + \".\" + this.$$name : this.$$parent.get();",
6363
" } else {",
64-
" return this.name;",
64+
" return this.$$name;",
6565
" }",
6666
" }",
6767
"}");

0 commit comments

Comments
 (0)