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