Merge pull request #630 from lostinthestory/swagger-gen

Added support for swagger doc to HTTP-In
This commit is contained in:
Nick O'Leary 2015-05-01 09:32:57 +01:00
commit a443491c0c
2 changed files with 10 additions and 2 deletions

View File

@ -32,6 +32,10 @@
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name"> <input type="text" id="node-input-name" placeholder="Name">
</div> </div>
<div class="form-row row-swagger-doc">
<label for="node-input-name"><i class="fa fa-tag"></i> Doc</label>
<input type="text" id="node-input-swaggerDoc">
</div>
<div id="node-input-tip" class="form-tips">The url will be relative to <code><span id="node-input-path"></span></code>.</div> <div id="node-input-tip" class="form-tips">The url will be relative to <code><span id="node-input-path"></span></code>.</div>
</script> </script>
@ -157,7 +161,8 @@
defaults: { defaults: {
name: {value:""}, name: {value:""},
url: {value:"",required:true}, url: {value:"",required:true},
method: {value:"get",required:true} method: {value:"get",required:true},
swaggerDoc: {type:"swagger-doc", required:false}
}, },
inputs:0, inputs:0,
outputs:1, outputs:1,
@ -194,7 +199,9 @@
$("#node-input-path").html(root); $("#node-input-path").html(root);
$("#node-input-tip").show(); $("#node-input-tip").show();
} }
//document.getElementById("node-config-wsdocpath").innerHTML= if(!RED.nodes.getType("swagger-doc")){
$('.row-swagger-doc').hide();
}
} }
}); });

View File

@ -50,6 +50,7 @@ module.exports = function(RED) {
this.url = n.url; this.url = n.url;
this.method = n.method; this.method = n.method;
this.swaggerDoc = n.swaggerDoc;
var node = this; var node = this;