~ "Error Status Codes" -> "Response Messages"

+ "Response Model" column in OperationView template
+ Response Model in Response Messages
This commit is contained in:
FilippQoma
2014-04-29 19:20:31 +03:00
parent ca47551d93
commit 9cedc0b4d7
3 changed files with 14 additions and 1 deletions

View File

@@ -4,6 +4,17 @@ class StatusCodeView extends Backbone.View
render: ->
template = @template()
$(@el).html(template(@model))
if swaggerUi.api.models.hasOwnProperty @model.responseModel
responseModel =
sampleJSON: JSON.stringify(swaggerUi.api.models[@model.responseModel].createJSONSample(), null, 2)
isParam: false
signature: swaggerUi.api.models[@model.responseModel].getMockSignature()
responseModelView = new SignatureView({model: responseModel, tagName: 'div'})
$('.model-signature', @$el).append responseModelView.render().el
else
$('.model-signature', @$el).html ''
@
template: ->

View File

@@ -64,12 +64,13 @@
{{/if}}
{{#if responseMessages}}
<div style='margin:0;padding:0;display:inline'></div>
<h4>Error Status Codes</h4>
<h4>Response Messages</h4>
<table class='fullwidth'>
<thead>
<tr>
<th>HTTP Status Code</th>
<th>Reason</th>
<th>Response Model</th>
</tr>
</thead>
<tbody class="operation-status">

View File

@@ -1,2 +1,3 @@
<td width='15%' class='code'>{{code}}</td>
<td>{{{message}}}</td>
<td width='50%'><span class="model-signature" /></td>