JSONValidator.py 276 B

123456789101112131415
  1. import json
  2. class JSONValidator():
  3. def validate(self, jsonString):
  4. obj = json.loads(jsonString)
  5. if not obj
  6. return false
  7. else if not obj.message
  8. return false
  9. else if not obj.message.lower() == "hello, world!"
  10. return false
  11. return true