12 个版本
0.6.0 | 2024 年 5 月 30 日 |
---|---|
0.5.3 | 2024 年 1 月 27 日 |
0.5.1 | 2023 年 7 月 13 日 |
0.5.0 | 2023 年 3 月 28 日 |
0.1.1 | 2023 年 2 月 17 日 |
#179 在 网页编程
3,871 每月下载量
在 3 crates 中使用
200KB
5K SLoC
库特性
- 通过 JSON-Schema-Test-Suite 测试(与 bowtie 中的其他实现比较)
- 检测无限循环陷阱
-
$schema
循环 - 验证循环
-
- 自定义
$schema
url - 基于词汇的验证
- 与 ECMA-262 正则表达式兼容(通过
optional/ecmascript-regex.json
的测试) - 格式断言
- 在 draft >= 2019-09 中启用标志
- 自定义格式注册
- 内置格式
- 正则表达式、uuid
- ipv4、ipv6
- 主机名、电子邮件
- idn-hostname、idn-email
- 日期、时间、日期时间、持续时间
- json-pointer、relative-json-pointer
- uri、uri-reference、uri-template
- iri、iri-reference
- 周期
- 内容断言
- 在 draft >= 7 中启用标志
- 内容编码
- base64
- 自定义
- 内容媒体类型
- application/json
- 自定义
- 内容模式
- 错误
- 可内省的
- 层次结构
- 使用
#
的可选显示
- 使用
- 输出
- 标志
- 基本
- 详细
- 自定义词汇表
命令行界面
安装: cargo install boon-cli
或从 发行版 下载
Usage: boon [OPTIONS] SCHEMA [INSTANCE...]
Options:
-h, --help Print help information
-q, --quiet Do not print errors
-d, --draft <VER> Draft used when '$schema' is missing. Valid values 4,
6, 7, 2019, 2020 (default 2020)
-o, --output <FMT> Output format. Valid values simple, alt, flag, basic,
detailed (default simple)
-f, --assert-format
Enable format assertions with draft >= 2019
-c, --assert-content
Enable content assertions with draft >= 7
--cacert <FILE> Use the specified PEM certificate file to verify the
peer. The file may contain multiple CA certificates
-k, --insecure Use insecure TLS connection
此 CLI 可以验证模式和多个实例。
它支持 JSON 和 YAML 文件
退出代码是
1
如果命令行参数无效。2
如果存在错误
依赖项
~4.5–6.5MB
~141K SLoC