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) => {
3030 switch ( vendor ) {
3131 case 'RAML 0.8' : return RAMLConfiguration . RAML08 ( ) ;
3232 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 ( ) ;
3539 case 'ASYNC 2.0' : return AsyncAPIConfiguration . Async20 ( ) ;
3640 default : throw new Error ( `Unknown vendor: ${ vendor } ` ) ;
3741 }
Original file line number Diff line number Diff line change @@ -132,8 +132,8 @@ export class ApiSearch {
132132 await fs . close ( fd ) ;
133133 const data = result . buffer . toString ( ) . trim ( ) ;
134134 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) ;
137137 if ( ! match ) {
138138 throw new Error ( 'Expected OAS but could not find version header.' ) ;
139139 }
You can’t perform that action at this time.
0 commit comments