Skip to content

Commit 114add9

Browse files
committed
Merge pull request swagger-api#740 from swagger-api/develop
added for 2.0 specs to support multi-select inputs
2 parents c7fc5d1 + 50cf3c3 commit 114add9

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

dist/swagger-ui.js

+21-18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// swagger-ui.js
2-
// version 2.1.0-alpha.5
2+
// version 2.1.0-alpha.6
33
$(function() {
44

55
// Helper function for vertically aligning DOM elements
@@ -712,7 +712,7 @@ function program5(depth0,data) {
712712

713713
var buffer = "", stack1;
714714
buffer += "\n ";
715-
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),data:data});
715+
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(8, program8, data),fn:self.program(6, program6, data),data:data});
716716
if(stack1 || stack1 === 0) { buffer += stack1; }
717717
buffer += "\n ";
718718
return buffer;
@@ -830,8 +830,8 @@ function program1(depth0,data) {
830830
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
831831
buffer += escapeExpression(stack1)
832832
+ "'>";
833-
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
834-
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
833+
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
834+
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
835835
buffer += escapeExpression(stack1)
836836
+ "</textarea>\n ";
837837
return buffer;
@@ -841,7 +841,7 @@ function program3(depth0,data) {
841841

842842
var buffer = "", stack1;
843843
buffer += "\n ";
844-
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
844+
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
845845
if(stack1 || stack1 === 0) { buffer += stack1; }
846846
buffer += "\n ";
847847
return buffer;
@@ -850,8 +850,8 @@ function program4(depth0,data) {
850850

851851
var buffer = "", stack1;
852852
buffer += "\n ";
853-
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
854-
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
853+
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
854+
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
855855
buffer += escapeExpression(stack1)
856856
+ "\n ";
857857
return buffer;
@@ -898,8 +898,8 @@ function program1(depth0,data) {
898898
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
899899
buffer += escapeExpression(stack1)
900900
+ "'>";
901-
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
902-
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
901+
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
902+
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
903903
buffer += escapeExpression(stack1)
904904
+ "</textarea>\n ";
905905
return buffer;
@@ -909,7 +909,7 @@ function program3(depth0,data) {
909909

910910
var buffer = "", stack1;
911911
buffer += "\n ";
912-
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
912+
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(6, program6, data),fn:self.program(4, program4, data),data:data});
913913
if(stack1 || stack1 === 0) { buffer += stack1; }
914914
buffer += "\n ";
915915
return buffer;
@@ -918,8 +918,8 @@ function program4(depth0,data) {
918918

919919
var buffer = "", stack1;
920920
buffer += "\n ";
921-
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
922-
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
921+
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
922+
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
923923
buffer += escapeExpression(stack1)
924924
+ "\n ";
925925
return buffer;
@@ -982,7 +982,7 @@ function program4(depth0,data) {
982982

983983
var buffer = "", stack1;
984984
buffer += "\n ";
985-
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
985+
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(7, program7, data),fn:self.program(5, program5, data),data:data});
986986
if(stack1 || stack1 === 0) { buffer += stack1; }
987987
buffer += "\n ";
988988
return buffer;
@@ -995,8 +995,8 @@ function program5(depth0,data) {
995995
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
996996
buffer += escapeExpression(stack1)
997997
+ "'>";
998-
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
999-
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
998+
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
999+
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
10001000
buffer += escapeExpression(stack1)
10011001
+ "</textarea>\n ";
10021002
return buffer;
@@ -1037,7 +1037,7 @@ function program12(depth0,data) {
10371037

10381038
var buffer = "", stack1;
10391039
buffer += "\n ";
1040-
stack1 = helpers['if'].call(depth0, depth0.defaultValue, {hash:{},inverse:self.program(15, program15, data),fn:self.program(13, program13, data),data:data});
1040+
stack1 = helpers['if'].call(depth0, depth0['default'], {hash:{},inverse:self.program(15, program15, data),fn:self.program(13, program13, data),data:data});
10411041
if(stack1 || stack1 === 0) { buffer += stack1; }
10421042
buffer += "\n ";
10431043
return buffer;
@@ -1050,8 +1050,8 @@ function program13(depth0,data) {
10501050
else { stack1 = depth0.name; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
10511051
buffer += escapeExpression(stack1)
10521052
+ "' placeholder='(required)' type='text' value='";
1053-
if (stack1 = helpers.defaultValue) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1054-
else { stack1 = depth0.defaultValue; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
1053+
if (stack1 = helpers['default']) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
1054+
else { stack1 = depth0['default']; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
10551055
buffer += escapeExpression(stack1)
10561056
+ "'/>\n ";
10571057
return buffer;
@@ -2354,6 +2354,9 @@ helpers = this.merge(helpers, Handlebars.helpers); data = data || {};
23542354
this.model.isFile = true;
23552355
}
23562356
this.model["default"] = this.model["default"] || this.model.defaultValue;
2357+
if (this.model.allowableValues) {
2358+
this.model.isList = true;
2359+
}
23572360
template = this.template();
23582361
$(this.el).html(template(this.model));
23592362
signatureModel = {

dist/swagger-ui.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

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

src/main/coffeescript/view/ParameterView.coffee

+3
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ class ParameterView extends Backbone.View
2525
@model.isFile = true if type and type.toLowerCase() == 'file'
2626
@model.default = (@model.default || @model.defaultValue)
2727

28+
if@model.allowableValues
29+
@model.isList = true
30+
2831
template = @template()
2932
$(@el).html(template(@model))
3033

0 commit comments

Comments
 (0)