File tree 1 file changed +13
-9
lines changed 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -82,16 +82,20 @@ exports.transform = function (model) {
82
82
}
83
83
}
84
84
model . definitions = [ ] ;
85
- model . tags . forEach ( function ( tag ) {
86
- tag . children . forEach ( function ( child ) {
87
- child . parameters . forEach ( function ( parameter ) { addComplexTypeMetadata ( parameter . schema , model . definitions ) ; } ) ;
88
- child . responses . forEach ( function ( response ) { addComplexTypeMetadata ( response . schema , model . definitions ) ; } ) ;
85
+ if ( model . tags ) {
86
+ model . tags . forEach ( function ( tag ) {
87
+ ( tag . children || [ ] ) . forEach ( function ( child ) {
88
+ ( child . parameters || [ ] ) . forEach ( function ( parameter ) { addComplexTypeMetadata ( parameter . schema , model . definitions ) ; } ) ;
89
+ ( child . responses || [ ] ) . forEach ( function ( response ) { addComplexTypeMetadata ( response . schema , model . definitions ) ; } ) ;
90
+ } ) ;
91
+ } ) ;
92
+ }
93
+ if ( model . children ) {
94
+ model . children . forEach ( function ( child ) {
95
+ ( child . parameters || [ ] ) . forEach ( function ( parameter ) { addComplexTypeMetadata ( parameter . schema , model . definitions ) ; } ) ;
96
+ ( child . responses || [ ] ) . forEach ( function ( response ) { addComplexTypeMetadata ( response . schema , model . definitions ) ; } ) ;
89
97
} ) ;
90
- } ) ;
91
- model . children . forEach ( function ( child ) {
92
- child . parameters . forEach ( function ( parameter ) { addComplexTypeMetadata ( parameter . schema , model . definitions ) ; } ) ;
93
- child . responses . forEach ( function ( response ) { addComplexTypeMetadata ( response . schema , model . definitions ) ; } ) ;
94
- } ) ;
98
+ }
95
99
96
100
return model ;
97
101
You can’t perform that action at this time.
0 commit comments