in src/main/java/com/epam/eco/commons/avro/avpath/AvPath.java [160:186]
private List<PathTemplate> buildPathTemplatesForPath(String path, Schema schema) {
List<PathTemplate> templates = new ArrayList<>();
if (schema.getType() == Type.NULL) {
// ignore
} else if (schema.getType() == Type.UNION) {
for (Schema unionType : schema.getTypes()) {
templates.addAll(buildPathTemplatesForPath(path, unionType));
}
} else {
if (schema.getType() == Type.ARRAY) {
templates.add(
PathTemplate.with(
"/" + path + PathUtils.ELEMENT_SELECTOR_MATCH_ALL,
schema.getElementType()));
} else if (schema.getType() == Type.MAP) {
templates.add(
PathTemplate.with(
"/" + path + PathUtils.ELEMENT_SELECTOR_MATCH_ALL,
schema.getValueType()));
}
templates.add(
PathTemplate.with(
"/" + path,
schema));
}
return templates;
}