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) {
299299 }
300300 } ) ;
301301
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+
302312 var className = swagger . info . title . toLowerCase ( ) . replace ( / ( ^ | [ ^ a - z 0 - 9 ] + ) [ a - z 0 - 9 ] / g,
303313 function ( str ) {
304314 return str . replace ( / ^ [ ^ a - z 0 - 9 ] + / , '' ) . toUpperCase ( ) ;
@@ -310,7 +320,7 @@ function swagger2node(data, options) {
310320
311321 if ( data . module ) {
312322 if ( data . prefix ) {
313- reject ( 'error: module name and prefix are conflicted.' ) ;
323+ reject ( 'module name and prefix are conflicted.' ) ;
314324 return ;
315325 }
316326 } else {
@@ -603,7 +613,7 @@ function wottd2node(data, options) {
603613
604614 if ( data . module ) {
605615 if ( data . prefix ) {
606- reject ( 'error: module name and prefix are conflicted' ) ;
616+ reject ( 'module name and prefix are conflicted' ) ;
607617 return ;
608618 }
609619 } else {
You can’t perform that action at this time.
0 commit comments