loosen validation to support unrecognized enum values #283
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the validation logic used by courier to ignore unrecognized enum values instead of returning a
JsError
.I copied the 3.1.1 version of ValidateDataAgainstSchema into the
naptime
repo, re-writing from java to scala. This class has a lot of options, so I removed support for options we're not using.To begin with, I just changed the invocation from the rest.li version to this version of the class in
CourierSerializer
. This was the only change required to get the framework to deserialize unknown enums in arrays or records without throwing an exception. There are a few other invocations ofValidateDataAgainstSchema.validate
scattered across the naptime repo, but I wanted to limit the blast radius of this PR.