dutchcodingcompany / laravel-json-schema
Adds a service provider for json schemas
1.0.0
2025-05-12 15:42 UTC
Requires
- php: ^8.0
- laravel/framework: ^10.0 | ^11.0 | ^12.0
- swaggest/json-schema: ^0.12.33
README
This package makes it easy to use swaggest/json-schema
in laravel.
Installation
You can install the package via composer:
composer require dutchcodingcompany/laravel-json-schema
Usage
- Create a json schema in the schema directory, eg.
storage/app/schema/example.json
- Reference the schema in the validator:
new \DutchCodingCompany\LaravelJsonSchema\Rules\JsonSchemaRule('example')
To customize the schema directory, use environment variable JSON_SCHEMA_DIRECTORY
or publish the config file.
License
The MIT License (MIT). Please see License File for more information.