Search by

alexfigures / symfony-jsonapi-bundle

alexfigures

JSON:API 1.1 bundle for Symfony with Doctrine and custom persistence

Package info

github.com/AlexFigures/jsonapi-symfony

Documentation

Type:symfony-bundle

pkg:composer/alexfigures/symfony-jsonapi-bundle

Fund package maintenance!

AlexFigures

Statistics

Installs: 270

Dependents: 0

Suggesters: 0

Stars: 3

Open Issues: 4

v1.0.0 2026-10-08 11:16 UTC

README

A JSON:API 1.1 bundle for Symfony, with Doctrine ORM or custom persistence, generated resource routes, relationships, profiles and Atomic Operations.

Status: preparing final 1.0 after the existing RC. The merged implementation has passed independent application verification across the compatibility targets. See verification for tested revisions and the release checklist for package publication.

Requirements and installation

PHP 8.2+ with Symfony 7.4; PHP 8.4.1+ for Symfony 8.x. Supported stable targets are Symfony 7.4 LTS and 8.1; Symfony 8.2-dev is tested for forward compatibility. The optional Doctrine provider targets ORM 3 / DBAL 3.8+ or 4.3+. Compatibility policy and evidence distinguish resolvable dependencies from officially verified support.

composer require alexfigures/symfony-jsonapi-bundle

For a published release candidate, use the explicit RC constraint in installation. Register the bundle, configure Doctrine and import the generated routes there.

Flex detects the root Bundle. Without Flex, add this entry to config/bundles.php:

AlexFigures\JsonApi\JsonApiBundle::class => ['all' => true],
use AlexFigures\JsonApi\Resource\Attribute\JsonApiResource;

#[JsonApiResource(type: 'articles')]
class Article
{
    // Add Doctrine mapping, one API ID and exposed attributes.
}

The quick start supplies the complete runnable entity, configuration, migration, first GET and first POST.

Core capabilities

  • Resource CRUD, linkage/related endpoints, includes and sparse fields.
  • Whitelisted filters/sorts, distinct-root pagination and bounded native relationship loading.
  • Validation/errors, media negotiation, cache validators and concurrent write preconditions.
  • Single-boundary Atomic Operations with rollback and generated-ID/lid workflows.
  • DI profiles/hooks, DTO representations/input, custom handlers/routes/providers and OpenAPI.

Applications own authorization policy, database topology and custom-provider cost. Distributed transactions, sharding/tenant frameworks and replication management are outside the contract.

Documentation · Public API · Support contract · BC policy · Upgrade to 1.0 · Changelog

The independent example application provides black-box consumer verification and is maintained separately. Release gates record exact revisions and required compatibility reruns.

Contributors: CONTRIBUTING, TESTING. Security reports: SECURITY. Licensed under MIT.