json schema: JsonSchemaReader, simplify code

This commit is contained in:
irengrig
2017-01-11 17:52:24 +01:00
parent 6b580f833b
commit 4841db826f
@@ -139,12 +139,9 @@ public class JsonSchemaReader {
if (current.getRef() != null) {
final JsonSchemaObject definition = findDefinition(myKey, current.getRef(), root, definitions);
if (definition == null) {
if (definitions == null) {
// just skip current item
current.setRef(null);
continue;
}
throw new RuntimeException("Can not find definition: " + current.getRef());
// just skip current item
current.setRef(null);
continue;
}
if (definition.getRef() != null && !"#".equals(definition.getRef())) {
queue.addFirst(current);