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.
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