A PHP implementation for validating JSON structures against JSON Schema drafts 3, 4, 6, and 7.
JSON Schema for PHP is a library that validates JSON data against JSON Schema specifications. It enables developers to ensure data integrity and structure compliance in PHP applications by supporting drafts 3, 4, 6, and 7 of the JSON Schema standard.
PHP developers who need to validate JSON data structures, such as those handling API requests, configuration files, or data serialization, and require compliance with specific JSON Schema drafts.
Developers choose this library for its robust multi-draft support, configurable validation modes, and features like type coercion and default value application, which simplify handling HTTP request data and ensure schema compliance.
JSON Schema for PHP
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports JSON Schema drafts 3, 4, 6, and 7 with compliance badges, ensuring reliable validation against established standards without needing multiple libraries.
Offers type coercion and default value application via flags like CHECK_MODE_COERCE_TYPES, simplifying HTTP request validation by automatically converting strings to expected types.
Provides multiple flags such as CHECK_MODE_EXCEPTIONS and CHECK_MODE_DISABLE_FORMAT, allowing developers to customize validation behavior for different use cases.
Includes a SchemaStorage system for resolving inline references, enabling the use of complex, self-referential schemas as demonstrated in the README examples.
Does not support JSON Schema drafts newer than 7, as admitted in the README, limiting compatibility with the latest schema features and standards.
Configuring inline reference resolution requires manual SchemaStorage setup, which can be cumbersome and error-prone compared to simpler validation libraries.
Using modes like CHECK_MODE_COERCE_TYPES or CHECK_MODE_APPLY_DEFAULTS modifies the original data, which can lead to unintended side effects and breaks immutability patterns.