Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: do not remove errors with no children #26

Merged
merged 2 commits into from
Aug 28, 2018
Merged

fix: do not remove errors with no children #26

merged 2 commits into from
Aug 28, 2018

Conversation

acheronfail
Copy link
Contributor

I encountered an issue where ajv errors like this:

[
  {
    keyword: 'type',
    dataPath: '/object/type',
    schemaPath: '#/definitions/type/anyOf/0/type',
    params: [Object],
    message: 'should be string'
  },
  {
    keyword: 'type',
    dataPath: '/object/type',
    schemaPath: '#/definitions/type/anyOf/1/type',
    params: [Object],
    message: 'should be array'
  },
  {
    keyword: 'anyOf',
    dataPath: '/object/type',
    schemaPath: '#/definitions/type/anyOf',
    params: {},
    message: 'should match some schema in anyOf'
  }
]

... would return a completely empty error message, since filterRedundantErrors would remove all the errors.

This PR makes sure that filterRedundantErrors doesn't remove the errors if the node doesn't have any children.

@torifat torifat merged commit cbacb75 into atlassian:master Aug 28, 2018
orgads pushed a commit to orgads/better-ajv-errors that referenced this pull request Oct 18, 2021
chore(deps): update dependency husky to v6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants