File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,13 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
3030 this . model . paramType = this . model . in || this . model . paramType ;
3131 this . model . isBody = this . model . paramType === 'body' || this . model . in === 'body' ;
3232 this . model . isFile = type && type . toLowerCase ( ) === 'file' ;
33- this . model . default = ( this . model . default || this . model . defaultValue ) ;
33+
34+ // Allow for default === false
35+ if ( typeof this . model . default === 'undefined' ) {
36+ this . model . default = this . model . defaultValue ;
37+ }
38+
39+ this . model . hasDefault = ( typeof this . model . default !== 'undefined' ) ;
3440 this . model . valueId = 'm' + this . model . name + Math . random ( ) ;
3541
3642 if ( this . model . allowableValues ) {
@@ -99,4 +105,4 @@ SwaggerUi.Views.ParameterView = Backbone.View.extend({
99105 }
100106 }
101107 }
102- } ) ;
108+ } ) ;
Original file line number Diff line number Diff line change 11<td class =' code{{ #if required }} required{{ /if }} ' ><label for =' {{ valueId }} ' >{{ name }} </labe ></td >
22<td >
3- <select {{ #isArray this }} multiple =' multiple' {{ /isArray }} class ={{ #if required }} ' parameter required' {{ else }} ' parameter' {{ /if }} name =' {{ name }} ' id =' {{ valueId }} ' >
4- {{ #if required }}
5- {{ else }}
6- {{ #if default }}
7- {{ else }}
8- {{ #isArray this }}
9- {{ else }}
10- <option selected =" " value =' ' ></option >
11- {{ /isArray }}
12- {{ /if }}
13- {{ /if }}
3+ <select {{ #isArray this }} multiple =" multiple" {{ /isArray }} class =" parameter {{ #if required }} required {{ /if }} " name =" {{ name }} " id =" {{ valueId }} " >
4+
5+ {{ #unless required }}
6+ <option {{ #unless hasDefault }} selected =" " {{ /unless }} value =' ' ></option >
7+ {{ /unless }}
8+
149 {{ #each allowableValues.descriptiveValues }}
15- {{ #if isDefault }}
16- <option selected =" " value =' {{ value }} ' >{{ value }} (default)</option >
17- {{ else }}
18- <option value =' {{ value }} ' >{{ value }} </option >
19- {{ /if }}
10+
11+ <option {{ #if isDefault }} selected =" " {{ /if }} value =' {{ value }} ' > {{ value }} {{ #if isDefault }} (default) {{ /if }} </option >
12+
2013 {{ /each }}
14+
2115 </select >
2216</td >
2317<td class =" markdown" >{{ #if required }} <strong >{{ /if }} {{{ description }}} {{ #if required }} </strong >{{ /if }} </td >
You can’t perform that action at this time.
0 commit comments