File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
demo/demo-server/api/amf-service Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,12 @@ const getConfiguration = (vendor) => {
30
30
switch ( vendor ) {
31
31
case 'RAML 0.8' : return RAMLConfiguration . RAML08 ( ) ;
32
32
case 'RAML 1.0' : return RAMLConfiguration . RAML10 ( ) ;
33
- case 'OAS 2.0' : return OASConfiguration . OAS20 ( ) ;
34
- case 'OAS 3.0' : return OASConfiguration . OAS30 ( ) ;
33
+ case 'OAS 2.0' :
34
+ case 'OAS 2' :
35
+ return OASConfiguration . OAS20 ( ) ;
36
+ case 'OAS 3.0' :
37
+ case 'OAS 3' :
38
+ return OASConfiguration . OAS30 ( ) ;
35
39
case 'ASYNC 2.0' : return AsyncAPIConfiguration . Async20 ( ) ;
36
40
default : throw new Error ( `Unknown vendor: ${ vendor } ` ) ;
37
41
}
Original file line number Diff line number Diff line change @@ -132,8 +132,8 @@ export class ApiSearch {
132
132
await fs . close ( fd ) ;
133
133
const data = result . buffer . toString ( ) . trim ( ) ;
134
134
if ( data [ 0 ] === '{' ) {
135
- // OAS 1/2
136
- const match = data . match ( / " s w a g g e r " (?: \s * ) ? : (?: \s * ) " ( . * ) " / im) ;
135
+ // OAS 1/2/3
136
+ const match = data . match ( / " (?: o p e n a p i | s w a g g e r ) " (?: \s * ) ? : (?: \s * ) " ( [ ^ " ] ) / im) ;
137
137
if ( ! match ) {
138
138
throw new Error ( 'Expected OAS but could not find version header.' ) ;
139
139
}
You can’t perform that action at this time.
0 commit comments