PHPackages                             haddowg/json-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. haddowg/json-api

ActiveLibrary[HTTP &amp; Networking](/categories/http)

haddowg/json-api
================

A modern, server-side JSON:API 1.1 library for PHP 8.3+.

v1.0.0(1mo ago)0171[2 PRs](https://github.com/haddowg/json-api/pulls)2MITPHPPHP ^8.3CI passing

Since Jul 13Pushed 1mo agoCompare

[ Source](https://github.com/haddowg/json-api)[ Packagist](https://packagist.org/packages/haddowg/json-api)[ Docs](https://github.com/haddowg/json-api)[ RSS](/packages/haddowg-json-api/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (12)Versions (3)Used By (2)

haddowg/json-api
================

[](#haddowgjson-api)

A modern, server-side [JSON:API 1.1](https://jsonapi.org/format/1.1/) library for PHP 8.3+.

[![CI](https://github.com/haddowg/json-api/actions/workflows/ci.yml/badge.svg)](https://github.com/haddowg/json-api/actions/workflows/ci.yml)

> **Part of the [jsonapi.rest](https://jsonapi.rest) suite** — a complete, spec-compliant JSON:API 1.1 stack for PHP: this **framework-agnostic core**, a [Symfony bundle](https://github.com/haddowg/json-api-symfony), a [Laravel package](https://github.com/haddowg/json-api-laravel), and a typed TypeScript client, bound together by one conformance-tested OpenAPI 3.1 contract.

`haddowg/json-api` is a typed, framework-agnostic toolkit for building [JSON:API 1.1](https://jsonapi.org/format/1.1/) compliant APIs in modern PHP — serialising resources, parsing and validating requests, negotiating content, and shaping responses exactly as the specification requires, without tying you to any particular framework or data layer.

The design leans on contemporary PHP: readonly value objects, enums, a typed exception hierarchy, PSR-7 v2 and PSR-15 throughout, and a fluent schema layer for declaring a resource type's attributes, relationships, filters, sorts, and validation in one place. First-class support for JSON:API profiles is built in rather than bolted on.

Requirements
------------

[](#requirements)

- PHP 8.3, 8.4, or 8.5

Installation
------------

[](#installation)

```
composer require haddowg/json-api
```

Documentation
-------------

[](#documentation)

The full documentation is published at **[haddowg.github.io/json-api](https://haddowg.github.io/json-api/)**. Start with [Getting started](https://haddowg.github.io/json-api/getting-started/) for an end-to-end walkthrough, or browse the [documentation index](https://haddowg.github.io/json-api/)for the reference pages.

Using a framework? The [Symfony bundle](https://github.com/haddowg/json-api-symfony) and [Laravel package](https://github.com/haddowg/json-api-laravel) wrap this core with idiomatic routing, validation, and a reference data layer.

Try it
------

[](#try-it)

The [worked music-catalog example](examples/music-catalog/) serves itself — run `docker compose up` in [`examples/music-catalog/`](examples/music-catalog/README.md) and browse the live API at `http://localhost:8080/albums`. It is also the single source of truth for every documentation snippet.

Contributing
------------

[](#contributing)

See [`CONTRIBUTING.md`](CONTRIBUTING.md). This project uses [Conventional Commits](https://www.conventionalcommits.org/) and automated releases via [release-please](https://github.com/googleapis/release-please).

Credits
-------

[](#credits)

This package began as a derivative work based on [woohoolabs/yin](https://github.com/woohoolabs/yin), and substantial portions of the codebase derive from it — sincere thanks to **Woohoo Labs and the yin contributors** for the original library. The fluent schema layer draws inspiration from [Laravel JSON:API](https://laraveljsonapi.io/), whose schema-first developer experience shaped this project's recommended API.

Licence
-------

[](#licence)

Released under the [MIT Licence](LICENSE), with dual copyright held by Gregory Haddow and Woohoo Labs and contributors (the original woohoolabs/yin authors).

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance92

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

49d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8deead49df3205ca08127866adcc5146559895aec400119a64ffe6f4e6477c65?d=identicon)[haddowg](/maintainers/haddowg)

---

Top Contributors

[![haddowg](https://avatars.githubusercontent.com/u/10784397?v=4)](https://github.com/haddowg "haddowg (144 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (2 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

atomic-operationshypermediajson-apijsonapiopenapiphppsr-15psr-7rest-apipsr-7apirestjsonapipsr-15JSON-API

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/haddowg-json-api/health.svg)

```
[![Health](https://phpackages.com/badges/haddowg-json-api/health.svg)](https://phpackages.com/packages/haddowg-json-api)
```

###  Alternatives

[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[cakephp/cakephp

The CakePHP framework

8.9k20.4M1.9k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.3k42.4k21](/packages/tempest-framework)[typo3/cms-core

TYPO3 CMS Core

3714.0M5.9k](/packages/typo3-cms-core)[mcp/sdk

Model Context Protocol SDK for Client and Server applications in PHP

1.6k3.0M159](/packages/mcp-sdk)[symfony/symfony

The Symfony PHP framework

31.4k87.7M2.3k](/packages/symfony-symfony)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
