PHPackages                             fezfez/php-json-schema-generator - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. fezfez/php-json-schema-generator

Abandoned → [fezfez/php-json-schema-generator](/?search=fezfez%2Fphp-json-schema-generator)Library[Parsing &amp; Serialization](/categories/parsing)

fezfez/php-json-schema-generator
================================

A JSON Schema Generator written in PHP. The implementation is based on current internet drafts.

1.0.0(11y ago)29.7kMITPHPPHP &gt;=5.4.0

Since Sep 30Pushed 11y ago1 watchersCompare

[ Source](https://github.com/fezfez/php-json-schema-generator)[ Packagist](https://packagist.org/packages/fezfez/php-json-schema-generator)[ Docs](https://github.com/fezfez/php-json-schema-generator)[ RSS](/packages/fezfez-php-json-schema-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

PHP JSON Schema Generator
=========================

[](#php-json-schema-generator)

======================

[![Build Status](https://camo.githubusercontent.com/3b90ba39827f41a9b7d7cd8f45a98cd18024b99ab80ccbb806a06b140012b908/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f66657a66657a2f7068702d6a736f6e2d736368656d612d67656e657261746f722e706e67)](http://travis-ci.org/fezfez/php-json-schema-generator)[![HHVM Status](https://camo.githubusercontent.com/2328edaffe1c98514661ea51e991b6c24fc3133c0f2c95f4d57de560deb300c1/687474703a2f2f6868766d2e683463632e64652f62616467652f66657a66657a2f7068702d6a736f6e2d736368656d612d67656e657261746f722e737667)](http://hhvm.h4cc.de/package/fezfez/php-json-schema-generator)[![Code Coverage](https://camo.githubusercontent.com/3a77ea9ce1fd50e57334e27be7e804fe943e275054fe5c902dc8144f7db95fe3/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66657a66657a2f7068702d6a736f6e2d736368656d612d67656e657261746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fezfez/php-json-schema-generator/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/dea7fff9d165910b44ca28e84caad5149a8f79995d1d219a544893f381f0122b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f66657a66657a2f7068702d6a736f6e2d736368656d612d67656e657261746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fezfez/php-json-schema-generator/?branch=master)[![Project Status](https://camo.githubusercontent.com/1a303fe07cbd8dead1523d226c2303336b10e1df080105010696c8eadd9dd887/687474703a2f2f7374696c6c6d61696e7461696e65642e636f6d2f66657a66657a2f7068702d6a736f6e2d736368656d612d67656e657261746f722e706e67)](http://stillmaintained.com/fezfez/php-json-schema-generator)

Package: php-json-schema-generator

PHP JSON Schema Generator

About JSON Schema
-----------------

[](#about-json-schema)

JSON has become a mainstay in the vast HTTP toolbox. In order to make JSON more stable and to increase the longevity of the data structure there must be some standards put into place. These standards will help to define the structure in a way that the industry can rely on. A uniform way to parse the data and interpret the meaning of the data elements can be found in building a schema that represents it.

Due to the flexible nature of JSON a solid Schema definition has been slow coming. At this time there is an internet draft being worked on.
()

The uses/pros/cons and other discussions related to what a schema can and cannot do for you are beyond the scope of this document. Seek your creativity for possible scenarios.

About This Tool
---------------

[](#about-this-tool)

It is a bit tedious to have to manually write out a JSON Schema every time a new REST point or Data object is created. Because JSON can be used to represent a variety of data objects it can be helpful to have a dynamic way to map from one object to a JSON Schema. A php array is considered an object here for the sake of ease of communication.

The goal of the tool is to provide an trivial implement for generating a JSON Schema off a wide range of objects. Some objects provide more options for rich schema generation and some do not. JSON itself is very light on metadata so there is a requirement to infer certain meanings based on the structure of the objects.

### Parser Objects Supported

[](#parser-objects-supported)

- JSON string
    - Defined [RFC 4627](http://tools.ietf.org/html/rfc4627)
    - No validation yet

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

[](#installation)

Simple, assuming you use composer. Add the below lines to your composer.json and run composer update.

```
"require": {
    "solvire/php-json-schema-generator": "dev-master"
}

```

Testing
-------

[](#testing)

PHPUnit should be included with the composer require-dev configuration. The installation will put an executable in the vendor/bin directly so it can be run from there.

Run:

```
$ vendor/bin/phpunit

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

4248d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aacc30f852e940d49eaf76c0cac6a97f3cfe4d38692ea774a57bc634196bda9?d=identicon)[fezfez](/maintainers/fezfez)

---

Top Contributors

[![fezfez](https://avatars.githubusercontent.com/u/1162307?v=4)](https://github.com/fezfez "fezfez (37 commits)")[![solvire](https://avatars.githubusercontent.com/u/1051614?v=4)](https://github.com/solvire "solvire (15 commits)")

---

Tags

phpjsonschemaparsergenerator

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fezfez-php-json-schema-generator/health.svg)

```
[![Health](https://phpackages.com/badges/fezfez-php-json-schema-generator/health.svg)](https://phpackages.com/packages/fezfez-php-json-schema-generator)
```

###  Alternatives

[evaisse/php-json-schema-generator

A JSON Schema Generator.

20298.5k1](/packages/evaisse-php-json-schema-generator)[psx/schema

Parse and generate data schema formats

57238.7k18](/packages/psx-schema)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6115.6k](/packages/sbsaga-toon)[open-code-modeling/json-schema-to-php

Parses JSON schema files and provides an API to easily generate code from JSON schema.

111.0k2](/packages/open-code-modeling-json-schema-to-php)

PHPackages © 2026

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