diff --git a/generators/python-v2/codegen/src/ast/Reference.ts b/generators/python-v2/codegen/src/ast/Reference.ts index fce6b41a06f..9d63aaa8c5f 100644 --- a/generators/python-v2/codegen/src/ast/Reference.ts +++ b/generators/python-v2/codegen/src/ast/Reference.ts @@ -18,7 +18,7 @@ export declare namespace Reference { /* The alias of the reference */ alias?: string; /* The path to the attribute of the reference */ - attrPath?: AttrPath; + attribute?: AttrPath; } } @@ -27,15 +27,15 @@ export class Reference extends AstNode { private modulePath: ModulePath; private genericTypes: Type[]; private alias: string | undefined; - private attrPath: AttrPath; + private attribute: AttrPath; - constructor({ name, modulePath, genericTypes, alias, attrPath }: Reference.Args) { + constructor({ name, modulePath, genericTypes, alias, attribute }: Reference.Args) { super(); this.name = name; this.modulePath = modulePath ?? []; this.genericTypes = genericTypes ?? []; this.alias = alias; - this.attrPath = attrPath ?? []; + this.attribute = attribute ?? []; } public write(writer: Writer): void { @@ -52,9 +52,9 @@ export class Reference extends AstNode { writer.write("]"); } - if (this.attrPath.length > 0) { + if (this.attribute.length > 0) { writer.write("."); - this.attrPath.forEach((attr, index) => { + this.attribute.forEach((attr, index) => { if (index > 0) { writer.write("."); } diff --git a/generators/python-v2/codegen/src/ast/__test__/PythonFile.test.ts b/generators/python-v2/codegen/src/ast/__test__/PythonFile.test.ts index fc3413b0d18..d576d6a1eff 100644 --- a/generators/python-v2/codegen/src/ast/__test__/PythonFile.test.ts +++ b/generators/python-v2/codegen/src/ast/__test__/PythonFile.test.ts @@ -88,7 +88,7 @@ describe("PythonFile", () => { const importedRef = python.reference({ modulePath: ["external_module"], name: "ImportedClass", - attrPath: ["nested", "attribute"] + attribute: ["nested", "attribute"] }); const field = python.field({ diff --git a/generators/python-v2/codegen/src/ast/__test__/Reference.test.ts b/generators/python-v2/codegen/src/ast/__test__/Reference.test.ts index c417b634401..78835725ab1 100644 --- a/generators/python-v2/codegen/src/ast/__test__/Reference.test.ts +++ b/generators/python-v2/codegen/src/ast/__test__/Reference.test.ts @@ -146,7 +146,7 @@ describe("Reference", () => { const reference = python.reference({ name: "AttrPathClass", modulePath: ["module"], - attrPath: ["attr1", "attr2"] + attribute: ["attr1", "attr2"] }); reference.write(writer); expect(await writer.toStringFormatted()).toMatchSnapshot(); diff --git a/generators/python-v2/codegen/src/ast/__test__/Type.test.ts b/generators/python-v2/codegen/src/ast/__test__/Type.test.ts index 219aae81955..19ae3808df2 100644 --- a/generators/python-v2/codegen/src/ast/__test__/Type.test.ts +++ b/generators/python-v2/codegen/src/ast/__test__/Type.test.ts @@ -104,7 +104,7 @@ describe("Type", () => { python.reference({ name: "MyClass", modulePath: ["module"], - attrPath: ["attr1", "attr2"] + attribute: ["attr1", "attr2"] }) ); referenceType.write(writer);