mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 11:23:58 +00:00
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();
|
||||
}
|
||||
}
|
||||
for (String pName : model.getProperties().keySet()) {
|
||||
Property p = model.getProperties().get(pName);
|
||||
if (p != null && p.getXml() != null && p.getXml().getAttribute() != null && p.getXml().getAttribute()) {
|
||||
attributes.put(pName, p);
|
||||
} else {
|
||||
elements.put(pName, p);
|
||||
// TODO: map objects will not enter this block
|
||||
if(model.getProperties() != null) {
|
||||
for (String pName : model.getProperties().keySet()) {
|
||||
Property p = model.getProperties().get(pName);
|
||||
if (p != null && p.getXml() != null && p.getXml().getAttribute() != null && p.getXml().getAttribute()) {
|
||||
attributes.put(pName, p);
|
||||
} else {
|
||||
elements.put(pName, p);
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append(indent(indent)).append(TAG_START);
|
||||
|
Loading…
Reference in New Issue
Block a user