Closed andersonba closed 10 years ago
interesting feature. is the additionalProperties not enough?
Thanks!
No, because additionalProperties throws an error when it finds an non-matching property. The "sanitize" attribute just filters out, removing from object or just silently ignored.
ok. but let's discuss the interface a bit, as this would be the 1st time that I deviate from the "standard". one thing that tickles me the wrong way is the use of the 'sanitize' attribute. specifically 2 things:
possible solutions:
what do you think?
Good idea! :thumbsup:
The second solution seems better.
I had to use sanitize
because I needed implement in a company's project where I work. Your solution is a better way to simplify this feature.
Done.
additionalProperties: 'remove'
What do you think?
I moved this feature to new branch: https://github.com/oferei/json-gate/pull/27
Cleans object, removing non-matching properties.
See bellow: