Closed cpliakas closed 10 years ago
I ran into similar problem testing for Drupal Rest
return new ResourceResponse(json_decode($problem->asJson(), TRUE));
I made a few other changes meanwhile to update for draft 7, which broke this PR. :-( I like the addition, though, so I readded it myself. Thanks, Chris!
Great! Thanks for incorporating it, much appreciated.
Awesome project.
It would be great to add an
ApiProblem::asArray()
method to get the compiled data as a native PHP array. The use case I have is to more easily integrate this project into a Silex app, where JSON data is returned by adding the following statement to your callback:Without a method to get a native PHP array, I have to re-implement some header-setting in the
json()
method in order for things to be treated the same way as JSON in the rest of the application.Thanks in advance for any attention you can give to this, Chris