A PHP implementation of the JSON:API specification for Doctrine ORM.
- JSON:API 1.1:
ext/profilecontent negotiation, link objects,jsonapi.ext/profile/meta,source.header, local identifiers (lid) - The Atomic Operations extension: ordered,
transactional
add/update/removewithlidresolution - Doctrine ORM integration
- Flexible filtering system with custom filter support
- Sorting, pagination, and sparse fieldsets
- Relationship handling (to-one and to-many)
- Validation support via Symfony Validator
- PSR-7 HTTP message interfaces
composer require modufolio/json-api- PHP 8.2 or higher
- Doctrine ORM 3.0+
- PSR-7 HTTP Message implementation
- PSR-17 HTTP Factory implementation
Tested against SQLite, MySQL 8.4, PostgreSQL 16 and SQL Server 2022.
The suite runs on SQLite in memory by default, so a fresh checkout needs no setup:
composer testThe engines disagree in ways that change which rows a query returns — where
NULLs sort, whether LIKE folds case, whether a partially-grouped SELECT is
even legal — so the same suite runs against each of them. docker compose up -d
brings the databases up locally:
DB_DRIVER=pdo_pgsql DB_PORT=5433 DB_USER=postgres DB_PASSWORD=secret vendor/bin/phpunit
DB_DRIVER=pdo_mysql DB_PORT=3307 DB_USER=root DB_PASSWORD=secret vendor/bin/phpunit
DB_DRIVER=pdo_sqlsrv DB_PORT=1434 DB_USER=sa DB_PASSWORD='Secret_1234' vendor/bin/phpunitCI runs the full matrix on every push.
- Installation and Setup
- Basic Usage
- Configuration
- Filtering
- Query Builder
- Atomic Operations
- API Reference
- Errors
MIT