#1901 Body parameter content type xml does not handle nested definition correctly

This commit is contained in:
Anna Bodnia
2016-01-25 16:29:46 +02:00
parent 01085edac1
commit 0691cc47ef
7 changed files with 17 additions and 21 deletions

2
dist/css/print.css vendored
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,

2
dist/css/screen.css vendored
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,

12
dist/swagger-ui.js vendored
View File

@@ -27162,7 +27162,7 @@ SwaggerUi.partials.signature = (function () {
var output, index;
config = config || {};
config.modelsToIgnore = config.modelsToIgnore || [];
var descriptor = _.isString($ref) ? getDescriptorByRef($ref, models, config)
var descriptor = _.isString($ref) ? getDescriptorByRef($ref, name, models, config)
: getDescriptor(name, definition, models, config);
if (!descriptor) {
@@ -27197,20 +27197,21 @@ SwaggerUi.partials.signature = (function () {
this.config = config || {};
this.config.modelsToIgnore = this.config.modelsToIgnore || [];
this.name = name;
this.name = getName(name, definition.xml);
this.definition = definition;
this.models = models;
this.type = type;
}
function getDescriptorByRef($ref, models, config) {
function getDescriptorByRef($ref, name, models, config) {
var modelType = simpleRef($ref);
var model = models[modelType] || {};
var name = model.name || modelType;
var type = model.type || 'object';
name = name || model.name;
if (config.modelsToIgnore.indexOf($ref) > -1) {
type = 'loop';
name = modelType;
} else {
config.modelsToIgnore.push($ref);
}
@@ -27224,14 +27225,11 @@ SwaggerUi.partials.signature = (function () {
function getDescriptor (name, definition, models, config){
var type = definition.type || 'object';
var xml = definition.xml || {};
if (!definition) {
return null;
}
name = getName(name, xml);
return new Descriptor(name, type, definition, models, config);
}

File diff suppressed because one or more lines are too long

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

@@ -836,7 +836,7 @@ SwaggerUi.partials.signature = (function () {
var output, index;
config = config || {};
config.modelsToIgnore = config.modelsToIgnore || [];
var descriptor = _.isString($ref) ? getDescriptorByRef($ref, models, config)
var descriptor = _.isString($ref) ? getDescriptorByRef($ref, name, models, config)
: getDescriptor(name, definition, models, config);
if (!descriptor) {
@@ -871,20 +871,21 @@ SwaggerUi.partials.signature = (function () {
this.config = config || {};
this.config.modelsToIgnore = this.config.modelsToIgnore || [];
this.name = name;
this.name = getName(name, definition.xml);
this.definition = definition;
this.models = models;
this.type = type;
}
function getDescriptorByRef($ref, models, config) {
function getDescriptorByRef($ref, name, models, config) {
var modelType = simpleRef($ref);
var model = models[modelType] || {};
var name = model.name || modelType;
var type = model.type || 'object';
name = name || model.name;
if (config.modelsToIgnore.indexOf($ref) > -1) {
type = 'loop';
name = modelType;
} else {
config.modelsToIgnore.push($ref);
}
@@ -898,14 +899,11 @@ SwaggerUi.partials.signature = (function () {
function getDescriptor (name, definition, models, config){
var type = definition.type || 'object';
var xml = definition.xml || {};
if (!definition) {
return null;
}
name = getName(name, xml);
return new Descriptor(name, type, definition, models, config);
}