class JsonSchemaInspector implements Inspector {

    static void fetchPaths(final String context, final List<String> paths, final Map<String, JsonSchema> properties) {
        for (final Map.Entry<String, JsonSchema> entry : properties.entrySet()) {
            final JsonSchema subschema = entry.getValue();

            String path;
            final String key = entry.getKey();
            if (context == null) {
                path = key;
            } else {
                path = context + "." + key;
            }

            if (subschema.isValueTypeSchema()) {
                paths.add(path);
            } else if (subschema.isObjectSchema()) {
                fetchPaths(path, paths, subschema.asObjectSchema().getProperties());
            } else if (subschema.isArraySchema()) {
                COLLECTION_PATHS.stream().map(p -> path + "." + p).forEach(paths::add);
                ObjectSchema itemSchema = getItemSchema(subschema.asArraySchema());
                if (itemSchema != null) {
                    fetchPaths(path + ARRAY_CONTEXT, paths, itemSchema.getProperties());
                }
            }
        }
    }

}