I am using fastjsonschema for validating json records against its schema. Some thing like this:
import fastjsonschema
validate = fastjsonschema.compile({'type': 'string'})
validate('hello')
If the json is valid, it returns the json string else return the error string. I just want to check if the json is valid or not. For this I can do a workaround of comparing output of the validate method and the json input.
But I want something cleaner. May be something like '$?' in unix or something better.
Could you suggest me?