#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

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);
}