We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce16178 commit 8dc3753Copy full SHA for 8dc3753
src/openApi/v3/parser/getOperationName.ts
@@ -6,9 +6,22 @@ import camelCase from 'camelcase';
6
* the most popular Javascript and Typescript writing style.
7
*/
8
export function getOperationName(value: string): string {
9
- const clean = value
+ let clean = value
10
.replace(/^[^a-zA-Z]+/g, '')
11
.replace(/[^\w\-]+/g, '-')
12
.trim();
13
+
14
+ if (clean.startsWith('List')) {
15
+ clean = 'List';
16
+ } else if (clean.startsWith('Fetch')) {
17
+ clean = 'Fetch';
18
+ } else if (clean.startsWith('Create')) {
19
+ clean = 'Create';
20
+ } else if (clean.startsWith('Update')) {
21
+ clean = 'Update';
22
+ } else if (clean.startsWith('Remove')) {
23
+ clean = 'Remove';
24
+ }
25
26
return camelCase(clean);
27
}
0 commit comments