spray-json icon indicating copy to clipboard operation
spray-json copied to clipboard

Add a validator to JsonParser

Open joshlemer opened this issue 10 years ago • 1 comments

It would be really nice to have a JSON validator as part of spray json, instead of having to wrap the dangerous json string in a Try. Maybe something like

JsonParser.isValid("""{ "key": "value" }""") // true
JsonParser.isValid("""{ "key : value"}""") // false (missing a quote after 'key'

joshlemer avatar Sep 11 '15 21:09 joshlemer

Yes, thanks. Good idea!

sirthias avatar Nov 02 '15 13:11 sirthias