File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
packages/openapi-ts/src/openApi/shared/utils Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @hey-api/openapi-ts " : patch
3+ ---
4+
5+ fix(parser): respect ` output.case ` when generating operation id
Original file line number Diff line number Diff line change @@ -37,13 +37,18 @@ export const operationToId = ({
3737} ) : string => {
3838 let result : string ;
3939
40+ const { output } = context . config ;
41+ const targetCase =
42+ ( output !== undefined && 'case' in output ? output . case : undefined ) ??
43+ 'camelCase' ;
44+
4045 if (
4146 id &&
4247 ( ! context . config . plugins [ '@hey-api/sdk' ] ||
4348 context . config . plugins [ '@hey-api/sdk' ] . config . operationId )
4449 ) {
4550 result = stringCase ( {
46- case : 'camelCase' ,
51+ case : targetCase ,
4752 value : sanitizeNamespaceIdentifier ( id ) ,
4853 } ) ;
4954 } else {
@@ -53,7 +58,7 @@ export const operationToId = ({
5358 . replace ( / [ / : + ] / g, '-' ) ;
5459
5560 result = stringCase ( {
56- case : 'camelCase' ,
61+ case : targetCase ,
5762 value : `${ method } -${ pathWithoutPlaceholders } ` ,
5863 } ) ;
5964 }
You can’t perform that action at this time.
0 commit comments