File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -43,11 +43,16 @@ export class DefaultOperationParser implements IOperationParser {
4343 }
4444
4545 name ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : string {
46- return lodash . startCase ( operation . operationId )
46+ if ( operation . operationId ) {
47+ return lodash . startCase ( operation . operationId )
48+ }
49+ return context . method . toUpperCase ( ) + " " + context . pattern
4750 }
4851
4952 value ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : string {
50- return lodash . startCase ( operation . operationId )
53+ let name = this . name ( operation , context )
54+ // replace all non-alphanumeric characters with '-'
55+ return name . replace ( / [ ^ a - z A - Z 0 - 9 ] / g, '-' ) ;
5156 }
5257
5358 action ( operation : OpenAPIV3 . OperationObject , context : OperationContext ) : string {
You can’t perform that action at this time.
0 commit comments