Selaa lähdekoodia

added for 2.0 specs to support multi-select inputs

bubble
Tony Tam 9 vuotta sitten
vanhempi
commit
50cf3c3597
4 muutettua tiedostoa jossa 26 lisäystä ja 20 poistoa
  1. +21
    -18
      dist/swagger-ui.js
  2. +1
    -1
      dist/swagger-ui.min.js
  3. +1
    -1
      package.json
  4. +3
    -0
      src/main/coffeescript/view/ParameterView.coffee

+ 21
- 18
dist/swagger-ui.js Näytä tiedosto

@@ -1,5 +1,5 @@
// swagger-ui.js
// version 2.1.0-alpha.5
// version 2.1.0-alpha.6
$(function() {
// Helper function for vertically aligning DOM elements
@@ -712,7 +712,7 @@ function program5(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),data:data});
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;
@@ -830,8 +830,8 @@ function program1(depth0,data) {
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "'>";
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</textarea>\n ";
return buffer;
@@ -841,7 +841,7 @@ function program3(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;
@@ -850,8 +850,8 @@ function program4(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "\n ";
return buffer;
@@ -898,8 +898,8 @@ function program1(depth0,data) {
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "'>";
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</textarea>\n ";
return buffer;
@@ -909,7 +909,7 @@ function program3(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;
@@ -918,8 +918,8 @@ function program4(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "\n ";
return buffer;
@@ -982,7 +982,7 @@ function program4(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;
@@ -995,8 +995,8 @@ function program5(depth0,data) {
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "'>";
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "</textarea>\n ";
return buffer;
@@ -1037,7 +1037,7 @@ function program12(depth0,data) {
var buffer = "", stack1;
buffer += "\n ";
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(15, program15, data),fn:self.program(13, program13, data),data:data});
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(15, program15, data),fn:self.program(13, program13, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n ";
return buffer;
@@ -1050,8 +1050,8 @@ function program13(depth0,data) {
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "' placeholder='(required)' type='text' value='";
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "'/>\n ";
return buffer;
@@ -2354,6 +2354,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
this.model.isFile = true;
}
this.model["default"] = this.model["default"] || this.model.defaultValue;
if (this.model.allowableValues) {
this.model.isList = true;
}
template = this.template();
$(this.el).html(template(this.model));
signatureModel = {


+ 1
- 1
dist/swagger-ui.min.js
File diff suppressed because it is too large
Näytä tiedosto


+ 1
- 1
package.json Näytä tiedosto

@@ -1,6 +1,6 @@
{
"name": "swagger-ui",
"version": "2.1.0-alpha.5",
"version": "2.1.0-alpha.6",
"description": "Swagger UI is a dependency-free collection of HTML, Javascript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API",
"scripts": {
"build": "PATH=$PATH:./node_modules/.bin cake dist",


+ 3
- 0
src/main/coffeescript/view/ParameterView.coffee Näytä tiedosto

@@ -25,6 +25,9 @@ class ParameterView extends Backbone.View
@model.isFile = true if type and type.toLowerCase() == 'file'
@model.default = (@model.default || @model.defaultValue)

if@model.allowableValues
@model.isList = true

template = @template()
$(@el).html(template(@model))



Ladataan…
Peruuta
Tallenna