-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fromJson method doesn't throw an appropriate exception for invalid JSON #3
Comments
Hm, I would agree. How do we detect invalid JSON, though? Please file a PR. :-) |
We should probably do the same for unparsable XML, too. |
Some clues can be found in the examples here http://php.net/manual/en/function.json-last-error.php |
For JSON you can consider using seld/jsonlint as that can check to make sure that the JSON is well-formed. It does not help the XML problem. |
JSON has been resolved here: #14 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When invalid JSON is passed to
ApiProblem::fromJson()
, I get a PHP notice and an exception:I think it would be appropriate to throw an exception about the invalid JSON, rather than one about the missing title.
The text was updated successfully, but these errors were encountered: