added success response per #1476
This commit is contained in:
@@ -84,7 +84,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
// Note: copied from CoffeeScript compiled file
|
||||
// TODO: redactor
|
||||
render: function() {
|
||||
var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, type, v, value;
|
||||
var a, auth, auths, code, contentTypeModel, isMethodSubmissionSupported, k, key, l, len, len1, len2, len3, len4, m, modelAuths, n, o, p, param, q, ref, ref1, ref2, ref3, ref4, ref5, responseContentTypeView, responseSignatureView, schema, schemaObj, scopeIndex, signatureModel, statusCode, successResponse, successDescription, type, v, value;
|
||||
isMethodSubmissionSupported = jQuery.inArray(this.model.method, this.model.supportedSubmitMethods()) >= 0;
|
||||
if (!isMethodSubmissionSupported) {
|
||||
this.model.isReadOnly = true;
|
||||
@@ -168,6 +168,7 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
|
||||
value = successResponse[key];
|
||||
this.model.successCode = key;
|
||||
if (typeof value === 'object' && typeof value.createJSONSample === 'function') {
|
||||
this.model.successDescription = value.description;
|
||||
signatureModel = {
|
||||
sampleJSON: JSON.stringify(value.createJSONSample(), void 0, 2),
|
||||
isParam: false,
|
||||
|
||||
@@ -42,9 +42,11 @@
|
||||
{{/oauth}}
|
||||
{{#if type}}
|
||||
<h4><span data-sw-translate>Response Class</span> (<span data-sw-translate>Status</span> {{successCode}})</h4>
|
||||
{{#if successDescription}}<div class="markdown">{{{successDescription}}}</div>{{/if}}
|
||||
<p><span class="model-signature" /></p>
|
||||
<br/>
|
||||
<div class="response-content-type" />
|
||||
|
||||
{{/if}}
|
||||
<form accept-charset='UTF-8' class='sandbox'>
|
||||
<div style='margin:0;padding:0;display:inline'></div>
|
||||
@@ -78,7 +80,6 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="operation-status">
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{{/if}}
|
||||
|
||||
Reference in New Issue
Block a user