Download the PHP package specdocular/php-json-schema without Composer
On this page you can find all versions of the php package specdocular/php-json-schema. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download specdocular/php-json-schema
More information about specdocular/php-json-schema
Files in specdocular/php-json-schema
Package php-json-schema
Short Description PHP implementation of JSON Schema (Draft 2020-12)
License MIT
Homepage https://github.com/specdocular/php-json-schema
Informations about the package php-json-schema
PHP JSON Schema
A type-safe, fluent PHP implementation of JSON Schema Draft 2020-12.
Requirements
- PHP 8.2 or higher
Installation
Usage
Build JSON Schema definitions using a fluent, type-safe API:
Strict vs Loose Descriptors
StrictFluentDescriptor(recommended) — provides type-specific method autocomplete. Methods likeminLength()are only available on string schemas,minimum()only on numeric schemas, etc.LooseFluentDescriptor— exposes all keywords on every schema. Useful when building schemas with multiple types.
Features
- Full JSON Schema Draft 2020-12 support (all 50 keywords, 7 vocabularies)
- Type-safe fluent API with IDE autocomplete
- Extensible keyword and vocabulary system
- Built-in schema validation (
VocabularyValidator,MetaSchemaValidator) - Framework-agnostic — no dependencies on Laravel or any framework
Note: This library builds JSON Schema definitions. It does not validate data against schemas — use a validation library like
justinrainbow/json-schemafor that.
Related Packages
| Package | Description |
|---|---|
| specdocular/php-openapi | Object-oriented OpenAPI 3.1.x builder (uses this package) |
| specdocular/laravel-rules-to-schema | Convert Laravel validation rules to JSON Schema (uses this package) |
| specdocular/laravel-openapi | Laravel integration for OpenAPI generation |
Contributing
Contributions are welcome. See CONTRIBUTING.md for setup, the required checks, and versioning.
Security
If you discover a security vulnerability, please follow the process in SECURITY.md rather than opening a public issue.
License
MIT. See LICENSE for details.