fix for #605, create default tag group

This commit is contained in:
Tony Tam
2014-09-26 09:52:27 -07:00
parent 4e15e9a068
commit b7a452eca3
5 changed files with 16 additions and 12 deletions

View File

@@ -289,8 +289,10 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
for(httpMethod in response.paths[path]) {
var operation = response.paths[path][httpMethod];
var tags = operation.tags;
if(typeof tags === 'undefined')
tags = [];
if(typeof tags === 'undefined') {
operation.tags = [ 'default' ];
tags = operation.tags;
}
var operationId = this.idFromOp(path, httpMethod, operation);
var operation = new Operation (
this,

8
dist/swagger-ui.js vendored
View File

@@ -266,7 +266,7 @@ function program4(depth0,data) {
var buffer = "", stack1;
buffer += "<div class='info_contact'><a href=\"mailto:"
+ escapeExpression(((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.contact)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.contact)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ "\">Contact the developer</a></div>";
return buffer;
}
@@ -275,9 +275,9 @@ function program6(depth0,data) {
var buffer = "", stack1;
buffer += "<div class='info_license'><a href='"
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ "'>"
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license)),stack1 == null || stack1 === false ? stack1 : stack1.url)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ "'>"
+ escapeExpression(((stack1 = ((stack1 = ((stack1 = depth0.info),stack1 == null || stack1 === false ? stack1 : stack1.license)),stack1 == null || stack1 === false ? stack1 : stack1.name)),typeof stack1 === functionType ? stack1.apply(depth0) : stack1))
+ "</a></div>";
return buffer;
}
@@ -298,7 +298,7 @@ function program10(depth0,data) {
if (stack1 = helpers.url) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.url; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)
+ "\"><img id=\"foo\" src=\"http://online.swagger.io/validator?url=";
+ "\"><img id=\"validator\" src=\"http://online.swagger.io/validator?url=";
if (stack1 = helpers.url) { stack1 = stack1.call(depth0, {hash:{},data:data}); }
else { stack1 = depth0.url; stack1 = typeof stack1 === functionType ? stack1.apply(depth0) : stack1; }
buffer += escapeExpression(stack1)

File diff suppressed because one or more lines are too long

View File

@@ -289,8 +289,10 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
for(httpMethod in response.paths[path]) {
var operation = response.paths[path][httpMethod];
var tags = operation.tags;
if(typeof tags === 'undefined')
tags = [];
if(typeof tags === 'undefined') {
operation.tags = [ 'default' ];
tags = operation.tags;
}
var operationId = this.idFromOp(path, httpMethod, operation);
var operation = new Operation (
this,

View File

@@ -3,8 +3,8 @@
<div class="info_title">{{info.title}}</div>
<div class="info_description">{{{info.description}}}</div>
{{#if info.termsOfServiceUrl}}<div class="info_tos"><a href="{{info.termsOfServiceUrl}}">Terms of service</a></div>{{/if}}
{{#if info.contact}}<div class='info_contact'><a href="mailto:{{info.contact}}">Contact the developer</a></div>{{/if}}
{{#if info.license}}<div class='info_license'><a href='{{info.license.name}}'>{{info.license.url}}</a></div>{{/if}}
{{#if info.contact}}<div class='info_contact'><a href="mailto:{{info.contact.name}}">Contact the developer</a></div>{{/if}}
{{#if info.license}}<div class='info_license'><a href='{{info.license.url}}'>{{info.license.name}}</a></div>{{/if}}
{{/if}}
</div>
<div class='container' id='resources_container'>
@@ -19,7 +19,7 @@
, <span style="font-variant: small-caps">api version</span>: {{info.version}}
{{/if}}]
{{#if validatorUrl}}
<span style="float:right"><a href="http://online.swagger.io/validator/debug?url={{url}}"><img id="foo" src="http://online.swagger.io/validator?url={{url}}"></a>
<span style="float:right"><a href="http://online.swagger.io/validator/debug?url={{url}}"><img id="validator" src="http://online.swagger.io/validator?url={{url}}"></a>
</span>
{{/if}}
</h4>