Fixed issue with json sample display in parameter view

This commit is contained in:
Anna Bodnia
2016-01-29 16:57:24 +02:00
parent f9ab874e7b
commit aa7ec97b07
8 changed files with 32 additions and 28 deletions

View File

@@ -82,7 +82,7 @@
.swagger-section pre .vhdl .attribute,
.swagger-section pre .clojure .attribute,
.swagger-section pre .coffeescript .property {
color: #8888ff;
color: #88F;
}
.swagger-section pre .keyword,
.swagger-section pre .id,

View File

@@ -82,7 +82,7 @@
.swagger-section pre .vhdl .attribute,
.swagger-section pre .clojure .attribute,
.swagger-section pre .coffeescript .property {
color: #8888ff;
color: #88F;
}
.swagger-section pre .keyword,
.swagger-section pre .id,

View File

@@ -801,17 +801,19 @@ SwaggerUi.Views.OperationView = Backbone.View.extend({
showSnippet: function () {
var contentTypeEl = this.$('[name=responseContentType]');
var xmlSnippetEl = this.$('.operation-status .snippet_xml, .response-class .snippet_xml');
var jsonSnippetEl = this.$('.operation-status .snippet_json, .response-class .snippet_json');
var contentType;
if (!contentTypeEl.length) { return; }
contentType = contentTypeEl.val();
if (contentType.indexOf('xml') > -1) {
this.$('.snippet_xml').show();
this.$('.snippet_json').hide();
xmlSnippetEl.show();
jsonSnippetEl.hide();
} else {
this.$('.snippet_json').show();
this.$('.snippet_xml').hide();
jsonSnippetEl.show();
xmlSnippetEl.hide();
}
},

View File

@@ -1,4 +1,3 @@
<ul class='operations' >
<li class='{{method}} operation' id='{{parentId}}_{{nickname}}'>
<div class='heading'>
@@ -41,12 +40,13 @@
</div>
{{/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" />
<div class="response-class">
<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" />
</div>
{{/if}}
{{#if headers}}