Skip to content

Commit d3e2af6

Browse files
authored
fix: operationToId should convert case based on config
1 parent 66f89a4 commit d3e2af6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/openapi-ts/src/openApi/shared/utils/operation.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,14 @@ export const operationToId = ({
6161
}): string => {
6262
let result: string;
6363

64+
const targetCase = context.config.output.case ?? 'camelCase';
6465
if (
6566
id &&
6667
(!context.config.plugins['@hey-api/sdk'] ||
6768
context.config.plugins['@hey-api/sdk'].operationId)
6869
) {
6970
result = stringCase({
70-
case: 'camelCase',
71+
case: targetCase,
7172
value: sanitizeNamespaceIdentifier(id),
7273
});
7374
} else {
@@ -77,7 +78,7 @@ export const operationToId = ({
7778
.replace(/[/:+]/g, '-');
7879

7980
result = stringCase({
80-
case: 'camelCase',
81+
case: targetCase,
8182
value: `${method}-${urlWithoutPlaceholders}`,
8283
});
8384
}

0 commit comments

Comments
 (0)