tobyzerner / json-api-php

JSON-API (http://jsonapi.org) responses in PHP.
MIT License
436 stars 79 forks source link

Throw an exception if attempting to include a relationship that doesn't exist #112

Closed tobyzerner closed 7 years ago

tobyzerner commented 7 years ago

From the spec:

If a server is unable to identify a relationship path or does not support inclusion of resources from a path, it MUST respond with 400 Bad Request.

tobyzerner commented 7 years ago

Actually, I suppose this already takes place in Parameters::getInclude.

I think it's better to give the user flexibility over how they validate their parameters, rather than enforce it in the serializers themselves.