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 = ({
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,7 +58,7 @@ export const operationToId = ({
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
}
You can’t perform that action at this time.
0 commit comments