opis/json-schema
Composer 安装命令:
composer require opis/json-schema
包简介
Json Schema Validator for PHP
README 文档
README
Validate JSON documents
Opis JSON Schema is a PHP implementation for the JSON Schema standard (draft-2020-12, draft-2019-09, draft-07 and draft-06), that will help you validate all sorts of JSON documents, whether they are configuration files or a set of data sent to a RESTful API endpoint.
The library's key features:
- Supports all keywords from all drafts (draft-2020-12 down to draft-06)
- Support for custom errors inside schema using
$errorkeyword - Support for custom PHP filters using
$filterskeyword - Advanced schema reuse using
$mapkeyword - Intuitive schema composition using slots
- Support for absolute & relative json pointers
- Support for URI templates
- Support for
$datakeyword - Support for casting
- Support for custom formats and media types
Documentation
The full documentation for this library can be found here. We provide documentation for both JSON Schema standard itself as well as for the library's own API.
License
Opis JSON Schema is licensed under the Apache License, Version 2.0.
Requirements
- PHP ^7.4 || ^8.0
Installation
Opis JSON Schema is available on Packagist, and it can be installed from a command line interface by using Composer.
composer require opis/json-schema
Or you could directly reference it into your composer.json file as a dependency
{
"require": {
"opis/json-schema": "^2.6"
}
}
opis/json-schema 适用场景与选型建议
opis/json-schema 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 43.55M 次下载、GitHub Stars 达 647, 最近一次更新时间为 2017 年 12 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「json」 「schema」 「validator」 「validation」 「json-schema」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 opis/json-schema 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 opis/json-schema 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 opis/json-schema 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Runn Me! Validation and Sanitization Library
Kinikit - PHP Application development framework MVC component
Extension for Opis JSON Schema
EAV modeling package for Eloquent and Laravel.
serialize Symfony Forms into JSON schema
ext-json wrapper with sane defaults
统计信息
- 总下载量: 43.55M
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 654
- 点击次数: 23
- 依赖项目数: 227
- 推荐数: 7
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2017-12-02