modufolio / json-api
JSON:API implementation for Doctrine ORM
v0.7.0
2026-08-27 14:10 UTC
Requires
- php: ^8.2
- doctrine/collections: ^2.0
- doctrine/orm: ^3.0
- psr/http-factory: ^1.0
- psr/http-message: ^2.0
- symfony/validator: ^7.0
- willdurand/negotiation: ^3.0
Requires (Dev)
- doctrine/dbal: ^4.0
- nyholm/psr7: ^1.8
- phpstan/phpstan: ^2.2
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^10.0
- symfony/cache: ^7.0
This package is not auto-updated.
Last update: 2026-08-27 14:11:33 UTC
README
A PHP implementation of the JSON:API specification for Doctrine ORM.
Features
- Full JSON:API 1.0 specification compliance
- Doctrine ORM integration
- Flexible filtering system with custom filter support
- Sorting, pagination, and sparse fieldsets
- Relationship handling (to-one and to-many)
- Content negotiation
- Validation support via Symfony Validator
- PSR-7 HTTP message interfaces
Installation
composer require modufolio/json-api
Requirements
- 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.
Testing
The suite runs on SQLite in memory by default, so a fresh checkout needs no setup:
composer test
The 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/phpunit
CI runs the full matrix on every push.
Documentation
License
MIT