Open wsong opened 8 years ago
Currently there is no way to do this but I agree that such a setting would be a valuable thing to have. Thanks for the ticket!
@wsong and @sirthias I need the same feature: throw an exception if a field name was not known instead of silently ignoring the object and using the default value of the optional key. Is there any plan to merge [PR #166]?
If I have a case class like:
case class FoobarClass(optional_value: Option[String] = None)
And I receive input like:
"{"optional_valeu": "test"}" (note that "optional_value" is misspelled)
It'd be nice to be able to throw an exception immediately instead of silently using the default value for optional_value. Is there a way to do this without defining my own RootJsonFormat?