Skip to content

Commit 1314d5d

Browse files
committed
fix(operation): ensure output case handling is robust by checking for object type before accessing 'case' property
1 parent a2fb1da commit 1314d5d

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
@@ -39,8 +39,9 @@ export const operationToId = ({
3939

4040
const { output } = context.config;
4141
const targetCase =
42-
(output !== undefined && 'case' in output ? output.case : undefined) ??
43-
'camelCase';
42+
(output !== undefined && typeof output === 'object' && 'case' in output
43+
? output.case
44+
: undefined) ?? 'camelCase';
4445

4546
if (
4647
id &&

0 commit comments

Comments
 (0)