jsoniter-scala
                                
                                
                                
                                    jsoniter-scala copied to clipboard
                            
                            
                            
                        Improve validation result in case of parsing issue
Hi,
We are very happy with jsoniter-scala (feature and performance), but we need a better way to manage parsing issue.
When the parsed Json does not match the Scala classes, I would like to
- get the full list of issues: missing/unexpected/badformat fields (with field names)
 - get this list in a processable format so that I am able to parse it and generate a human readable and structured response
- "format is not valid"
 - "issues":
- issue="missing field", field="field1"
 - issue="unexpected field", field="fieldA"
 - issue="wrong field format", field="field1", expectedType="String", actualType="Int"
 
 
 
jsoniter-java is throwing an exception in case of multiple fields issues http://jsoniter.com/java-features.html#validation, but
- afaik it does not work if multiple issue types occur (missing and unexpected fields for instance)
 - the validation result is not easy to process, but that is possible to parse the exception message
 
What do you think ?
@gvauvert The Macros API generates code that is secure and performant, so it will not generate code that gather errors, infer or trace JSON structure paths. You can create custom codecs which will do that for your data structures or for any supported data types.