json4s/json4s — pull request #63 by efuquen (2013-08-26 19:17:11+00:00)
Title: Strict mode 2.10

Currently json4s will ignore MappingExceptions when it's extracting to a class and the constructor field being extracted is of type Option, instead it will put it as None. In our experience this is not good behavior, we wouldn't want incorrectly specified fields to simply be dropped, it could be important business data that's just incorrectly being specified. If there is some error going on in the json submission in which an incorrect type of data is being submitted we want to know about and fail fast, regardless of whether it's just an Option type or not.

So, I've added an extra field of a boolean type to Formatter called strict which defaults to false to not break the previous behavior. If this field is set to true then the extract function will continue to throw a MappingException up the stack when unexpected types are hit for Optional fields. I've also written a simply test case to go through most of the possible scenarios for simple Int, Double, String, and Map types.