fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #2041 from alexvuka1/fix-operation-id-casing

fix: operationToId should convert case based on config

authored by

Lubos and committed by
GitHub
d687cdd7 6ec51d9f

+12 -2
+5
.changeset/witty-dolls-applaud.md
··· 1 + --- 2 + "@hey-api/openapi-ts": patch 3 + --- 4 + 5 + fix(parser): respect `output.case` when generating operation id
+7 -2
packages/openapi-ts/src/openApi/shared/utils/operation.ts
··· 37 37 }): string => { 38 38 let result: string; 39 39 40 + const { output } = context.config; 41 + const targetCase = 42 + (output !== undefined && 'case' in output ? output.case : undefined) ?? 43 + 'camelCase'; 44 + 40 45 if ( 41 46 id && 42 47 (!context.config.plugins['@hey-api/sdk'] || 43 48 context.config.plugins['@hey-api/sdk'].config.operationId) 44 49 ) { 45 50 result = stringCase({ 46 - case: 'camelCase', 51 + case: targetCase, 47 52 value: sanitizeNamespaceIdentifier(id), 48 53 }); 49 54 } else { ··· 53 58 .replace(/[/:+]/g, '-'); 54 59 55 60 result = stringCase({ 56 - case: 'camelCase', 61 + case: targetCase, 57 62 value: `${method}-${pathWithoutPlaceholders}`, 58 63 }); 59 64 }