forked from loafle/openapi-generator-original
fix for npe on map models
This commit is contained in:
parent
539496d735
commit
b827d06077
@ -84,12 +84,15 @@ public class XmlExampleGenerator {
|
|||||||
name = xml.getName();
|
name = xml.getName();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (String pName : model.getProperties().keySet()) {
|
// TODO: map objects will not enter this block
|
||||||
Property p = model.getProperties().get(pName);
|
if(model.getProperties() != null) {
|
||||||
if (p != null && p.getXml() != null && p.getXml().getAttribute() != null && p.getXml().getAttribute()) {
|
for (String pName : model.getProperties().keySet()) {
|
||||||
attributes.put(pName, p);
|
Property p = model.getProperties().get(pName);
|
||||||
} else {
|
if (p != null && p.getXml() != null && p.getXml().getAttribute() != null && p.getXml().getAttribute()) {
|
||||||
elements.put(pName, p);
|
attributes.put(pName, p);
|
||||||
|
} else {
|
||||||
|
elements.put(pName, p);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sb.append(indent(indent)).append(TAG_START);
|
sb.append(indent(indent)).append(TAG_START);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user