#1901 Body parameter content type xml does not handle nested definition correctly
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user