Closed designermonkey closed 8 years ago
Do you mean to validate json ? Something like https://github.com/Seldaek/jsonlint ?
No, I mean so that we can just use
$json = json_encode($validator->getFailures());
Currently it returns a FailureCollection of Failure objects. It would be great if it could just be serializable as json from the objects.
Here is the spec for the interface: http://php.net/manual/en/class.jsonserializable.php
@designermonkey That seems like a straightforward change. Send a PR for that and I'll review.
ok (hopes I get some time to myself to do it asap) :)
As this is fixed with #121 . Closing the issue.
I've just come across a great scenario where I need to get all of the failure data as json for a vue.js component to take over.
Would it be a good idea to implement
JsonSerializable
in the Failure class?