public Map<String, Model> definitions (ObjectNode node, String location, ParseResult result) {
if(node == null)
return null;
Set<String> schemas = getKeys(node);
Map<String, Model> output = new LinkedHashMap<String, Model>();
for(String schemaName : schemas) {
JsonNode schema = node.get(schemaName);
if(schema.getNodeType().equals(JsonNodeType.OBJECT)) {
Model model = definition((ObjectNode) schema, location + "." + schemaName, result);
if(model != null) {
output.put(schemaName, model);
}
}
else {
result.invalidType(location, schemaName, "object", schema);
}
}
return output;
}