Merge pull request #1000 from mohsen1/develop_2.0

Render response headers.
This commit is contained in:
Tony Tam
2015-03-06 17:17:34 -05:00
7 changed files with 1233 additions and 27 deletions

View File

@@ -21,7 +21,7 @@ class MainView extends Backbone.View
else
# Default validator
@model.validatorUrl = "http://online.swagger.io/validator"
render: ->
if @model.securityDefinitions
for name of @model.securityDefinitions
@@ -61,10 +61,10 @@ class MainView extends Backbone.View
# Render a resource and add it to resources li
resource.id = resource.id.replace(/\s/g, '_')
resourceView = new ResourceView({
model: resource,
tagName: 'li',
id: 'resource_' + resource.id,
className: 'resource',
model: resource,
tagName: 'li',
id: 'resource_' + resource.id,
className: 'resource',
auths: auths,
swaggerOptions: @options.swaggerOptions
})

1155
src/main/html/css/print.css Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,11 @@
{{#if info}}
<div class="info_title">{{info.title}}</div>
<div class="info_description markdown">{{{info.description}}}</div>
{{#if externalDocs}}
<h5>More documentations</h5>
<p>{{externalDocs.description}}</p>
<a href="{{externalDocs.url}}" target="_blank">{{externalDocs.url}}</a>
{{/if}}
{{#if info.termsOfServiceUrl}}<div class="info_tos"><a href="{{info.termsOfServiceUrl}}">Terms of service</a></div>{{/if}}
{{#if info.contact.name}}<div class='info_name'>Created by {{info.contact.name}}</div>{{/if}}
{{#if info.contact.url}}<div class='info_url'>See more at <a href="{{info.contact.url}}">{{info.contact.url}}</a></div>{{/if}}

View File

@@ -74,10 +74,11 @@
<th>HTTP Status Code</th>
<th>Reason</th>
<th>Response Model</th>
<th>Headers</th>
</tr>
</thead>
<tbody class="operation-status">
</tbody>
</table>
{{/if}}

View File

@@ -1,3 +1,16 @@
<td width='15%' class='code'>{{code}}</td>
<td>{{{message}}}</td>
<td width='50%'><span class="model-signature" /></td>
<td width='50%'><span class="model-signature" /></td>
<td class="headers">
<table>
<tbody>
{{#each headers}}
<tr>
<td>{{@key}}</td>
<td>{{this.description}}</td>
<td>{{this.type}}</td>
</tr>
{{/each}}
</tbody>
</table>
</td>