File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -235,15 +235,16 @@ module.exports = function(RED) {
235235 Object . keys ( swaggerDocNode . responses ) . forEach ( status => {
236236 const responseDetails = swaggerDocNode . responses [ status ] ;
237237 operation . responses [ status ] = {
238- description : responseDetails . description || '' ,
239- content : {
240- 'application/json' : {
241- schema : {
242- // Define or reference your schema here
243- }
244- }
245- }
238+ description : responseDetails . description || 'No description' ,
239+ content : { }
246240 } ;
241+
242+ // Conditionally add schema if it's set
243+ if ( responseDetails . schema ) {
244+ operation . responses [ status ] . content [ 'application/json' ] = {
245+ schema : responseDetails . schema
246+ } ;
247+ }
247248 } ) ;
248249 } else {
249250 console . error ( 'swaggerDocNode.responses is not an object or is null:' , swaggerDocNode . responses ) ;
You can’t perform that action at this time.
0 commit comments