API revisions
With Laravel JSON:API 3.x, an API has dated revisions: each client is pinned on one, and the code keeps only the latest shape. The generator writes one document per revision, each one showing the API exactly as a client of that revision sees it.
ark4ne/laravel-api-revisionsOne document per revision
Each document names its revision in its integrations.json_api.revision setting, a case of the enum the application
configures in revisions.enum of ark4ne/laravel-api-revisions:
'documents' => [
'v2026-09' => [
'info' => ['title' => 'API', 'version' => '2026-09-01'],
'integrations' => [
'json_api' => ['revision' => App\Http\ApiRevision::Initial],
],
],
'v2026-12' => [
'info' => ['title' => 'API', 'version' => '2026-12-01'],
'integrations' => [
'json_api' => ['revision' => App\Http\ApiRevision::Labels],
],
],
],
A document without the setting documents the head, the latest revision.
What changes per revision
Every request the generator builds, the samples and the form requests, is read at the revision of the document. A field
renamed by was() has its old name, a field added by since() is absent before, one removed by until() is absent
after:
'label' => Schema::string('title')->max(120)->describe('The title.')
->was(ApiRevision::Initial, name: 'name'),
'summary' => Schema::string('content')->nullable()->since(ApiRevision::Labels),
'status' => Schema::enum(Stage::class)->until(ApiRevision::Initial),
{
"name": { "type": "string", "maxLength": 120, "description": "The title." },
"status": { "type": "string", "enum": ["draft", "published"] }
}
{
"label": { "type": "string", "maxLength": 120, "description": "The title." },
"summary": { "type": ["string", "null"] }
}
The relationships, the nested resources, the include and fields[type] parameters and the rules of the form requests
follow the revision too.
Changelog in the description
The description of each document lists the newer revisions, from the #[Meta] of their cases:
Newer revisions:
- 2026-12-01: Names become labels
- 2027-01-15: Members replace writers
Checks
The resources of each document are checked at its revision, as jsonapi:check does: its findings are warnings of the
document, with their code and revision, so --strict fails on them.
A resource that does not exist at the revision of a document is a warning: exclude its routes from that document with
routes.exclude.
'v2026-09' => [
'routes' => ['include' => ['api/*'], 'exclude' => ['api/labels*']],
'integrations' => [
'json_api' => ['revision' => App\Http\ApiRevision::Initial],
],
],