Skip to content

Errors with different path got overwritten #81

Open
@a1png

Description

@a1png

When there are errors of more than one different paths in ajv error list, the helpers.makeTree function will overwrite the previous errors in the path with the new one in the reduce function:

paths &&
      paths.reduce((obj, path, i) => {
        obj.children[path] = obj.children[path] || { children: {}, errors: [] };
        if (i === paths.length - 1) {
          obj.children[path].errors.push(ajvError);
        }
        return obj.children[path];
      }, root);

Is this an intended design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions