Fixed corner case
This commit is contained in:
parent
fec18df298
commit
d23ca0e246
|
@ -263,19 +263,16 @@ public abstract class ElementMapper {
|
|||
throw new RuntimeException(stringBuffer.toString());
|
||||
}
|
||||
|
||||
|
||||
protected static JsonNode analizeFullJson(JsonNode jsonNode) {
|
||||
String cls = jsonNode.get(Element.CLASS_PROPERTY).asText();
|
||||
if(!knownTypes.containsKey(cls)) {
|
||||
jsonNode = setAvailableSuperclass(jsonNode);
|
||||
}
|
||||
Iterator<String> iterator = jsonNode.fieldNames();
|
||||
while(iterator.hasNext()) {
|
||||
String fieldName = iterator.next();
|
||||
JsonNode jn = jsonNode.get(fieldName);
|
||||
if(jn.getNodeType() == JsonNodeType.OBJECT) {
|
||||
if(jn.has(Element.CLASS_PROPERTY)) {
|
||||
String cls = jn.get(Element.CLASS_PROPERTY).asText();
|
||||
if(!knownTypes.containsKey(cls)) {
|
||||
jn = setAvailableSuperclass(jn);
|
||||
}
|
||||
}
|
||||
jn = analizeFullJson(jn);
|
||||
((ObjectNode) jsonNode).set(fieldName, jn);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue