PHPackages                             zero-to-prod/json-schema4 - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. zero-to-prod/json-schema4

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

zero-to-prod/json-schema4
=========================

A DataModel for the Json Schema Draft 4 Specification

v1.1.0(8mo ago)1238MITPHPPHP &gt;=8.1.0CI passing

Since Jan 1Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/json-schema4)[ Packagist](https://packagist.org/packages/zero-to-prod/json-schema4)[ Docs](https://github.com/zero-to-prod/json-schema4)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-json-schema4/feed)WikiDiscussions main Synced 1mo ago

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

Zerotoprod\\JsonSchema4
=======================

[](#zerotoprodjsonschema4)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/json-schema4)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/6d21610838a30ace817e707eebb9e680b3d5c3110bf96361fe802bd9f2074b44/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f6a736f6e2d736368656d61342f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/json-schema4/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/814d607d8f74ff99c23b16e269936827fe91e86b9da836f1e40699308f971b2c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f6a736f6e2d736368656d61342f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/json-schema4/actions)[![Packagist Downloads](https://camo.githubusercontent.com/58d89bfcfde85b37e2eda5e1fb96af44e0d396197b853bd516f7013154df5aea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f6a736f6e2d736368656d61343f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/json-schema4/stats)[![Packagist Version](https://camo.githubusercontent.com/68d9c825391b9624e0e44ffff8be1bd36c945d51eba47aa2194a45151cbbe9b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f6a736f6e2d736368656d61343f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/json-schema4)[![License](https://camo.githubusercontent.com/084970cd8723b2428134869b23089466dccf589e7aea73fe99df44ff157c6dae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f6a736f6e2d736368656d61343f636f6c6f723d726564)](https://github.com/zero-to-prod/json-schema4/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/b0514d1acbce50389485979f3009af96eb88a7aec8b7ecb73af70f69546952ca/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f6a736f6e2d736368656d61342e737667)](https://wakatime.com/badge/github/zero-to-prod/json-schema4)[![Hits-of-Code](https://camo.githubusercontent.com/399df7247a53ce6af189f6a55f317d374d22ff90766092ff426799c6d892f553/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f6a736f6e2d736368656d61343f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/json-schema4/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
- [Publishing DataModels](#publishing-datamodels)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

A [DataModel](https://github.com/zero-to-prod/data-model) for the [Json Schema Draft 4](https://json-schema.org/draft-04/draft-zyp-json-schema-04) Specification.

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

[](#requirements)

- PHP 8.1 or higher.

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

[](#installation)

Install `Zerotoprod\JsonSchema4` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/json-schema4
```

This will add the package to your project's dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/json-schema4)
vendor/bin/zero-to-prod-json-schema4

# Publish to custom directory
vendor/bin/zero-to-prod-json-schema4 /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-json-schema4"
        ],
        "post-update-cmd": [
            "zero-to-prod-json-schema4"
        ]
    }
}
```

Usage
-----

[](#usage)

```
use Zerotoprod\JsonSchema4\JsonSchema4;

$JsonSchema4 = JsonSchema4::from(json_decode($json, true));

$JsonSchema4->schema;
```

Publishing DataModels
---------------------

[](#publishing-datamodels)

You can directly import these files into your project like this:

```
./vendor/bin/json-schema4 app/JsonSchema4
```

The first argument is the destination of where the files are copied to.

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

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/json-schema4/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

37

—

LowBetter than 82% of packages

Maintenance64

Regular maintenance activity

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.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 ~22 days

Recently: every ~57 days

Total

12

Last Release

249d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

data-modeljsonschemaphpzero-to-prodJsonSchema4json-schema4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-json-schema4/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-json-schema4/health.svg)](https://phpackages.com/packages/zero-to-prod-json-schema4)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

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