File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,16 @@ function swagger2node(data, options) {
299
299
}
300
300
} ) ;
301
301
302
+ if ( swagger . swagger !== '2.0' ) {
303
+ reject ( 'unsupported version of OpenAPI document' ) ;
304
+ return ;
305
+ }
306
+
307
+ if ( ! swagger . info . title ) {
308
+ reject ( 'No title is specified in OpenAPI document' ) ;
309
+ return ;
310
+ }
311
+
302
312
var className = swagger . info . title . toLowerCase ( ) . replace ( / ( ^ | [ ^ a - z 0 - 9 ] + ) [ a - z 0 - 9 ] / g,
303
313
function ( str ) {
304
314
return str . replace ( / ^ [ ^ a - z 0 - 9 ] + / , '' ) . toUpperCase ( ) ;
@@ -310,7 +320,7 @@ function swagger2node(data, options) {
310
320
311
321
if ( data . module ) {
312
322
if ( data . prefix ) {
313
- reject ( 'error: module name and prefix are conflicted.' ) ;
323
+ reject ( 'module name and prefix are conflicted.' ) ;
314
324
return ;
315
325
}
316
326
} else {
@@ -603,7 +613,7 @@ function wottd2node(data, options) {
603
613
604
614
if ( data . module ) {
605
615
if ( data . prefix ) {
606
- reject ( 'error: module name and prefix are conflicted' ) ;
616
+ reject ( 'module name and prefix are conflicted' ) ;
607
617
return ;
608
618
}
609
619
} else {
You can’t perform that action at this time.
0 commit comments