loosen validation to support unrecognized enum values#283
Open
zdrudi wants to merge 9 commits intocoursera:masterfrom
Open
loosen validation to support unrecognized enum values#283zdrudi wants to merge 9 commits intocoursera:masterfrom
zdrudi wants to merge 9 commits intocoursera:masterfrom
Conversation
dguo-coursera
approved these changes
Nov 24, 2021
|
Kudos, SonarCloud Quality Gate passed!
|
jeremycarroll
approved these changes
Mar 17, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
naptimerepo, 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.validatescattered across the naptime repo, but I wanted to limit the blast radius of this PR.