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

Expose errors from filter feature #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jonasfj
Copy link

@jonasfj jonasfj commented Apr 13, 2015

  • Make errors available when using the filter feature
  • Ignore errors from additionalProperties: false
  • Formalize semantics in README.md
  • Warn about input mutation.
  • Warn that this is a non-standard feature.
  • Added test cases covering the filter feature

This is clearly an implementation-specific feature. I'll admit I thought it was a bit weird when I first saw the feature... But I now realize that is has some use-cases, and, hence, think that issue #44 deserves a bit of attention.


Interface change, before the feature was available both using the option flag filter: true and using validator.filter. As the validator.filter interface doesn't expose errors I think it makes most sense to restrict to the option flag method (it seems like a good way to provide various implementation-specific options).


Formal semantics, I changed the implementation to ignore errors from additionalProperties: false when filter: true... But still produce all the other errors. I'm not what semantics are best for this feature, but it seems reasonably sane to say that idea to change the semantics of additionalProperties: false from producing validation errors, to instead deleting additional properties.

This way the validation errors produced are still well-defined, all we have a clear change in semantics for objects with additionalProperties: false.

  * Make errors available when using this feature
  * Ignore errors from `additionalProperties: false`
  * Formalize semantics in `README.md`
  * Warn about input mutation.
  * Warn that this is a non-standard feature.
  * Added test cases covering the `filter` feature
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.

None yet

1 participant