dutchcodingcompany/laravel-json-schema
Composer 安装命令:
composer require dutchcodingcompany/laravel-json-schema
包简介
Adds a service provider for json schemas
README 文档
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 using one of the rules:
new \DutchCodingCompany\LaravelJsonSchema\Rules\JsonSchemaRule('example')new \DutchCodingCompany\LaravelJsonSchema\Rules\JsonSchemaAttributeRule('type', TypeEnum::class)(be careful to validate the attributetypein this case)
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.
统计信息
- 总下载量: 1.58k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-07