Skip to content

Commit 87b6460

Browse files
committed
fix: Restore tsCamelCase for choice accessor method names
Field names like 'value IVL_TS' (CCDA) need camelCase normalization before uppercasing to produce valid method names.
1 parent 82fc48c commit 87b6460

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/api/writer-generator/typescript/profile.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
} from "@root/typeschema/types";
1515
import type { TypeSchemaIndex } from "@root/typeschema/utils";
1616
import {
17+
tsCamelCase,
1718
tsExtensionFlatTypeName,
1819
tsFieldName,
1920
tsModulePath,
@@ -570,7 +571,7 @@ const generateFieldAccessors = (w: TypeScript, factoryInfo: ProfileFactoryInfo)
570571
}
571572

572573
for (const a of factoryInfo.accessors) {
573-
const methodBaseName = uppercaseFirstLetter(a.name);
574+
const methodBaseName = uppercaseFirstLetter(tsCamelCase(a.name));
574575
const fieldAccess = tsFieldName(a.name);
575576
w.curlyBlock([`get${methodBaseName}`, "()", `: ${a.tsType} | undefined`], () => {
576577
w.lineSM(`return ${tsGet("this.resource", fieldAccess)} as ${a.tsType} | undefined`);

0 commit comments

Comments
 (0)