php-json-schema-model-generator and php-schema2class

These two tools are competitors, as both generate PHP classes from JSON schemas, but tool A also incorporates validation rules directly into the generated PHP code, a feature not explicitly mentioned for tool B.

php-schema2class
51
Established
Maintenance 13/25
Adoption 9/25
Maturity 16/25
Community 19/25
Maintenance 10/25
Adoption 7/25
Maturity 16/25
Community 18/25
Stars: 81
Forks: 18
Downloads:
Commits (30d): 0
Language: PHP
License: MIT
Stars: 36
Forks: 16
Downloads:
Commits (30d): 0
Language: PHP
License: MIT
No Package No Dependents
No Package No Dependents

About php-json-schema-model-generator

wol-soft/php-json-schema-model-generator

Creates (immutable) PHP model classes from JSON-Schema files including all validation rules as PHP code

Generates models with fluent builder patterns and IDE auto-completion support for nested objects, accepting JSON-Schema from files or OpenAPI v3 specs. Validation rules are transpiled directly into PHP code at generation time, eliminating runtime overhead and enabling static analysis. Designed for API middleware workflows where request data can be validated and instantiated as type-safe models without duplicating schema constraints.

About php-schema2class

martin-helmich/php-schema2class

Generate PHP classes from JSON schemas

Generates strongly-typed PHP classes with built-in JSON validation and immutable accessor patterns (`withX()` methods) from JSON schemas, supporting backwards compatibility down to PHP 5.6 via a `--target-php` flag. The tool uses the `justinrainbow/json-schema` validator to enforce schema constraints at runtime and automatically infers target namespaces from `composer.json` PSR-4 configuration. Configuration files (`.s2c.yaml`) enable batch generation workflows for evolving schemas in multi-file projects.

Scores updated daily from GitHub, PyPI, and npm data. How scores work