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(8mo ago)27.7k↓24%1[1 issues](https://github.com/FreeElephants/json-api-dto/issues)BSD-2-ClausePHPCI passing

Since Mar 13Pushed 8mo 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 2d 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

33

—

LowBetter than 72% of packages

Maintenance51

Moderate activity, may be stable

Popularity28

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

247d 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

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M738](/packages/sylius-sylius)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M159](/packages/algolia-algoliasearch-client-php)[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)

PHPackages © 2026

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