Change to set name for array elements from items.xml.name if it is set. Another issue after fixing this was for complex objects, that the name for element (from xmlelement annotation) was getting overridden by ref name (from xmlelementwrapper annotation)
This commit is contained in:
@@ -740,7 +740,13 @@ SwaggerUi.partials.signature = (function () {
|
||||
|
||||
if (!items) { return getErrorMessage(); }
|
||||
|
||||
value = createSchemaXML(name, items, models, config);
|
||||
// To provide the name for the items from xml.name if it is provided | https://github.com/swagger-api/swagger-core/issues/2047
|
||||
var key = name;
|
||||
if(items.xml != null && items.xml.name != null) {
|
||||
key = items.xml.name;
|
||||
}
|
||||
|
||||
value = createSchemaXML(key, items, models, config);
|
||||
|
||||
if (namespace) {
|
||||
attributes.push(namespace);
|
||||
@@ -841,6 +847,10 @@ SwaggerUi.partials.signature = (function () {
|
||||
}
|
||||
|
||||
xml = prop.xml || {};
|
||||
// To provide the name for the object from xml.name if it is provided. If it is not, then it would be derived from the ref | https://github.com/swagger-api/swagger-core/issues/2047
|
||||
if(xml != null && xml.name != null) {
|
||||
key = xml.name;
|
||||
}
|
||||
result = createSchemaXML(key, prop, models, config);
|
||||
|
||||
if (xml.attribute) {
|
||||
|
||||
Reference in New Issue
Block a user