JSON Schema for PHP
3.6k
Stars
369
Forks
12
Open issues
30
Contributors
AI Analysis
A PHP library implementing JSON Schema validation with support for Draft-3, Draft-4, Draft-6, Draft-7, and Draft 2019-09 specifications. It enables developers to validate JSON structures against schemas and includes type coercion for HTTP data. This library serves the PHP ecosystem specifically and is best suited for server-side validation in PHP applications; developers using other languages or frameworks will need different implementations.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Mature PHP JSON Schema validator with broad spec support and modest but stable adoption
json-schema is a PHP library that validates JSON data structures against JSON Schema specifications (Draft 3 through Draft 2019-09). Built and maintained since 2011, it serves PHP developers who need schema validation without external dependencies. Adoption appears concentrated in PHP web frameworks and APIs; real-world usage is difficult to quantify but Composer download metrics suggest consistent, modest-scale use. The project prioritizes spec compliance over aggressive feature expansion.
Created in 2011 by Justin Rainbow, this project emerged as PHP's primary JSON Schema validator when the specification was stabilizing. It has tracked multiple JSON Schema drafts over 15 years, maintaining backward compatibility while incrementally adding support for newer specifications. The Bowtie compliance testing integration (visible in README badges) suggests recent efforts to maintain spec alignment.
Growth appears linear and modest: 3,632 stars accumulated over 15 years suggests stable niche adoption rather than viral growth. The 2 stars gained in the last 7 days (as of 2026-07-08) is consistent with slow, mature-project trajectory. Last push on 2026-07-03 indicates active maintenance. Growth likely driven by PHP ecosystem inertia and lack of competing implementations rather than feature innovation.
Adoption not verified through explicit case studies. Indirect signals: Composer package registry listing with 'Total Downloads' metric mentioned but values not provided in excerpt; stable star count over years suggests recurring installations. Presence in Packagist (standard PHP dependency hub) indicates some production use, but scale unknown. No public testimonials or enterprise user list visible.
Based on README, the library uses a validator factory pattern with constraint-based validation logic (references Factory, Constraints). It supports schema references (inline and file-based), type coercion, and default value application. Likely implements recursive descent validation but actual implementation patterns cannot be verified from README alone.
CI/CD workflow badge present in README (GitHub Actions), but test coverage percentage not documented. README includes multiple code examples suggesting tested functionality, but comprehensive coverage metrics not verified.
Active maintenance confirmed: last commit 2026-07-03 (5 days before analysis date). CI pipeline operational. README references current Bowtie compliance reports and multiple JSON Schema drafts. No evidence of abandoned state; consistent low-velocity commits typical of stable, feature-complete libraries.
ADOPT IF: you are building PHP applications that require JSON Schema validation (especially API input validation, configuration validation) and need broad Draft support without external service dependencies. Library is stable, actively maintained, and well-integrated into PHP package ecosystem. AVOID IF: you need cutting-edge JSON Schema features from the very latest drafts (2020-12 or later) — README indicates some newer draft features may be missing. Also avoid if you require TypeScript/Node.js or Python (use language-specific implementations instead). MONITOR IF: you rely on Draft 2019-09 or newer features — check Bowtie compliance badge regularly to confirm draft coverage matches your schema version.
Independent dimensions
Mainstream potential
3/10
Technical importance
6/10
Adoption evidence
4/10
- Adoption scale unquantified: Composer download counts not provided; cannot verify production usage volume beyond inferred modest scale.
- Incomplete newer draft support: README explicitly states 'Features of newer Drafts might not be supported'; projects using latest JSON Schema drafts may face compatibility gaps.
- Limited maintenance bandwidth: 2 stars in 7 days and long creation-to-present span suggests small maintainer team; bug fixes and new draft support may lag community releases.
- Language-specific ceiling: PHP ecosystem represents bounded addressable market; mainstream_potential inherently limited compared to polyglot tools.
- Spec drift risk: JSON Schema specifications continue evolving (2020-12, 2024 drafts exist); library may fall behind if maintainer team capacity decreases.
Project will likely remain stable but slow-growing, serving as the de facto PHP JSON Schema validator for the foreseeable future. Adoption curve will probably flatten rather than accelerate, as early adopters are already users. Maintenance will persist at current low-velocity pace. Unlikely to see major feature expansion unless new PHP use cases (e.g., async validation, performance-critical systems) create demand.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- PHP
- License
- MIT
- Last updated
- 1w ago
- Created
- 187mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Avoid using `mb_detect_encoding()` for JSON Schema string length validation
Draft06Constraint, Draft07Constraint, and Draft2019Constraint instantiate all constraint objects unconditionally per schema node
AdditionalPropertiesConstraint reports incorrect error path when additionalProperties is a schema
RequiredConstraint::incrementPath is duplicated across drafts instead of living on JsonPointer
Inconsistent and incomplete ECMA-to-PCRE pattern replacements in createPregMatchPattern
Open pull requests
No open pull requests.
Top contributors
Recent releases
Similar repos
json-schema-org/json-schema-spec
JSON Schema is a vocabulary and specification for validating, annotating, and...
python-jsonschema/jsonschema
jsonschema is a mature Python implementation of the JSON Schema specification,...
voxpupuli/json-schema
A Ruby library for validating JSON objects against JSON Schema specifications...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
3.6k | +2 | PHP | 7/10 | 1w ago |
|
|
5.1k | — | JavaScript | 8/10 | 7d ago |
|
|
5k | — | Python | 9/10 | 4d ago |
|
|
1.6k | — | Ruby | 8/10 | 5d ago |
|
|
1.5k | — | PHP | 8/10 | 1mo ago |
|
|
1.3k | — | PHP | 8/10 | 1w ago |
4,959 stars vs. 3,632; serves different language ecosystem. Python version likely larger due to Python's greater popularity in data validation contexts, but projects are not direct substitutes.
5,058 stars; this is the specification repository itself, not a validator implementation. json-schema provides the PHP implementation of this spec.
1,646 stars; Ruby ecosystem alternative. Lower adoption than PHP version, likely reflecting Ruby's smaller footprint for this use case.
1,500 stars; also PHP but focuses on Schema.org vocabularies rather than general JSON Schema validation. Different problem domain, not direct competitor.
1,325 stars; validates JSON syntax, not structure against schemas. Complementary tool, not replacement.