-
-
Notifications
You must be signed in to change notification settings - Fork 173
Description
Hello! I have a test case that's failing at the moment, and the behavior suggests that it's because the presence of extra keys (beyond those corresponding to the fields of a case class) is not problematic when attempting to parse JSON to a value of the case class, when the reader in question is in scope by virtue of the case class having been written with a derives
declaration.
- Is this true?
- If so, is there a way to get alternative, stricter parse behavior (i.e., require an exact match between the keyset in the JSON object being parsed, and the fields of the target case class), without writing a custom reader?
I understand the value of having more lax / less strict parsing behavior, particularly in the context of trait hierarchies, but in my case there's no hierarchy and I'd like to opt for stricter behavior if it's not too much additional effort. If it's helpful, I could describe the test case and why it suggests to me that the behavior is as I describe above.
Thanks in advance!