egeriis / laravel-jsonapi

Make it a breeze to create a jsonapi.org compliant APIs with Laravel 5.
MIT License
146 stars 27 forks source link

errors: ensure response matches jsonapi spec #28

Closed mfn closed 8 years ago

mfn commented 8 years ago

Per http://jsonapi.org/format/1.0/#errors 'status' and 'code' must be of type string, if present.

For completeness I added casts for 'detail' and 'title' too, just in case someone would pass an integer at a point.

This allows validating the response with e.g. http://jsonapi.org/faq/#is-there-a-json-schema-describing-json-api successfully.