PHPackages                             free-elephants/json-api-dto - 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. [API Development](/categories/api)
4. /
5. free-elephants/json-api-dto

ActiveLibrary[API Development](/categories/api)

free-elephants/json-api-dto
===========================

JsonApi Document Structure Types

0.1.0(6mo ago)25.8k↓17.3%1[1 issues](https://github.com/FreeElephants/json-api-dto/issues)BSD-2-ClausePHPCI passing

Since Mar 13Pushed 6mo ago2 watchersCompare

[ Source](https://github.com/FreeElephants/json-api-dto)[ Packagist](https://packagist.org/packages/free-elephants/json-api-dto)[ RSS](/packages/free-elephants-json-api-dto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (13)Used By (0)

Json Api Toolkit
================

[](#json-api-toolkit)

[![Build Status](https://github.com/FreeElephants/json-api-dto/workflows/CI/badge.svg)](https://github.com/FreeElephants/json-api-dto/actions)[![codecov](https://camo.githubusercontent.com/81a92157fa3770b4d34351cb2c70bea36e9a048e63434b35aff37220b94e0333/68747470733a2f2f636f6465636f762e696f2f67682f46726565456c657068616e74732f6a736f6e2d6170692d64746f2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/FreeElephants/json-api-dto)[![Installs](https://camo.githubusercontent.com/191a17390d4ef08d0d4136d20b7aedd4b683c98ebb213b59ab7a0f7c6e137c42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f667265652d656c657068616e74732f6a736f6e2d6170692d64746f2e737667)](https://packagist.org/packages/free-elephants/json-api-dto)[![Releases](https://camo.githubusercontent.com/8790314312863849e44bbd4776b69a0d822f428fba8afa790b4b046abfdb74b0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f667265652d656c657068616e74732f6a736f6e2d6170692d64746f2e737667)](https://github.com/FreeElephants/json-api-dto/releases)

Features:
---------

[](#features)

Build Data Transfer Objects from PSR7 Messages.

Full typed objects from request or response body.

See example in [test](/tests/FreeElephants/JsonApiToolkit/DTO/DocumentTest.php).

Union types support for relationships in PHP 8.

Usage
-----

[](#usage)

Extend super types in your own json api documents and it's parts:

- \\FreeElephants\\JsonApi\\DTO\\AbstractAttributes
- \\FreeElephants\\JsonApi\\DTO\\AbstractDocument
- \\FreeElephants\\JsonApi\\DTO\\AbstractRelationships
- \\FreeElephants\\JsonApi\\DTO\\AbstractResourceObject

And use as properties types:

- \\FreeElephants\\JsonApi\\DTO\\RelationshipToOne
- \\FreeElephants\\JsonApi\\DTO\\ResourceIdentifierObject

See tests/ for more examples.

### Install

[](#install)

`composer require free-elephants/json-api-dto`

Development
-----------

[](#development)

All dev env is dockerized. Your can use make receipts and `bin/` scripts without locally installed php, composer.

For run tests with different php version change `PHP_VERSION` value in .env and rebuild image with `make build`.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance56

Moderate activity, may be stable

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 Bus Factor1

Top contributor holds 92.3% 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

Every ~23 days

Recently: every ~51 days

Total

11

Last Release

201d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b764f6cd1eb52054cf0e07297309c60e37382542268822b3bd5edd97729d056?d=identicon)[samizdam](/maintainers/samizdam)

---

Top Contributors

[![samizdam](https://avatars.githubusercontent.com/u/1556299?v=4)](https://github.com/samizdam "samizdam (12 commits)")[![vehsamrak](https://avatars.githubusercontent.com/u/4052919?v=4)](https://github.com/vehsamrak "vehsamrak (1 commits)")

---

Tags

data-transfer-objectjsonapijsonapi-resourcesphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/free-elephants-json-api-dto/health.svg)

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

###  Alternatives

[algolia/algoliasearch-client-php

API powering the features of Algolia.

69433.0M114](/packages/algolia-algoliasearch-client-php)[swisnl/json-api-client

A PHP package for mapping remote JSON:API resources to Eloquent like models and collections.

211473.2k12](/packages/swisnl-json-api-client)[php-heroku-client/php-heroku-client

A PHP client for the Heroku Platform API

24404.8k4](/packages/php-heroku-client-php-heroku-client)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[trycourier/courier

Courier PHP SDK

16643.9k](/packages/trycourier-courier)[commercetools/commercetools-sdk

The official PHP SDK for the commercetools Composable Commerce APIs

19281.5k](/packages/commercetools-commercetools-sdk)

PHPackages © 2026

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