PHPackages                             mpmontanez/json-schema-to-php-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mpmontanez/json-schema-to-php-generator

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

mpmontanez/json-schema-to-php-generator
=======================================

Code generation tool for converting JSON schema documents to simple PHP classes.

0.0.11(9y ago)52513PHP

Since Jan 30Pushed 9y ago1 watchersCompare

[ Source](https://github.com/mpmontanez/json-schema-to-php-generator)[ Packagist](https://packagist.org/packages/mpmontanez/json-schema-to-php-generator)[ RSS](/packages/mpmontanez-json-schema-to-php-generator/feed)WikiDiscussions master Synced 3w ago

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

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

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

Objective: build a code generation tool that will convert JSON spec files into simple PHP classes. Java inspiration:

Demo
----

[](#demo)

Generate sample generated-code by executing the following:

```
php cli/generate.php

```

The schema source directory will be the 'json-schemas' folder and the code will be placed in the 'generated-code' folder.

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

[](#installation)

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

```

Usage
-----

[](#usage)

To generate PHP code from a set of JSON schema files, provide the following paramters to the Generator: the base working directory, the JSON schema source folder name, the generated code destination folder name, and the base namespace to use for the generated PHP classes.

*BEWARE* The initial contents of the destination folder will be deleted when calling generate().

```
$generator = new \mpmontanez\JsonSchemaToPhpGenerator\Generator(
    __DIR__ . '/../', 'json-schemas', 'generated-code', 'Sample\\GeneratedCode\\');
$generator->generate();

```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~0 days

Total

2

Last Release

3438d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2363592?v=4)[Matthew Montañez](/maintainers/mpmontanez)[@mpmontanez](https://github.com/mpmontanez)

---

Top Contributors

[![MatthewMontanez](https://avatars.githubusercontent.com/u/8420913?v=4)](https://github.com/MatthewMontanez "MatthewMontanez (14 commits)")[![mpmontanez](https://avatars.githubusercontent.com/u/2363592?v=4)](https://github.com/mpmontanez "mpmontanez (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[coenjacobs/mozart

Composes all dependencies as a package inside a WordPress plugin

4753.9M23](/packages/coenjacobs-mozart)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[browscap/browscap-php

Standalone replacement for php's native get\_browser() function

4424.0M23](/packages/browscap-browscap-php)[akeneo/pim-community-dev

Akeneo PIM, the future of catalog management is open!

1.0k620.8k86](/packages/akeneo-pim-community-dev)[brianhenryie/strauss

Prefixes dependencies namespaces so they are unique to your plugin

186406.5k30](/packages/brianhenryie-strauss)[flarum/core

Delightfully simple forum software.

201.4M2.2k](/packages/flarum-core)

PHPackages © 2026

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