modufolio/json-api

JSON:API implementation for Doctrine ORM

Maintainers

Package info

github.com/modufolio/json-api

pkg:composer/modufolio/json-api

Transparency log

Statistics

Installs: 584

Dependents: 2

Suggesters: 0

Stars: 0

Open Issues: 0

v0.7.0 2026-08-27 14:10 UTC

This package is not auto-updated.

Last update: 2026-08-27 14:11:33 UTC


README

License: MIT codecov

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