Skip to content
MundoProgra JSON:API
Menu

Reference

Known limits

What the package does not do, and a few details worth knowing before you run into them by surprise.

Limits

  • It registers no routes or controllers. The endpoints, and their authorization, are yours. See Getting started.
  • Extensions and profiles. JSON:API 1.1 is negotiated, but extensions and profiles are not implemented: any ext is rejected with 415 and profiles are ignored. There is no lid either.
  • PUT. It is not validated unless allow_put is on; the specification only defines PATCH for updates.
  • include without a loaded relationship. An include on a relationship that was not loaded is silently ignored: eager loading is the job of jsonApiInclude().
  • Custom paginators. A paginator that implements Laravel's contract but is not Illuminate's LengthAwarePaginator class gets no links or meta.
  • Relationship endpoints. The cardinality rules (an identifier or a list) and the type rules are written by your application. See Relationship endpoints.
  • The tests' schema. The official JSON:API schema used in the package tests is the one for version 1.0.

Details worth knowing

Observed in a real application that uses the package:

  • The language of a validation detail. In a validation error, the title comes out in the package's language, but the detail is the Laravel rule's message, in your application's language. If you do not have the validation texts translated (for example lang/es/validation.php), it comes out in English even if the title comes out in Spanish.
  • The Password rule. When a password breaks several rules of Password::min(8)->letters()->…, only the first error carries the validation.password code; the others come out as validation.failed, because those messages do not carry the rule name.
  • Headers. With strict_headers set to true, a client that sends Accept: application/json inside the package scope gets a 406. If you are migrating an API with existing clients, see Configuration.