jsonschema-rs:Rust Json 校验工具
如果你没有听(用)过 Json Schema,请允许我首先简单介绍一下。JSON Schema 是用于验证 JSON 数据结构的工具,如果你厌恶对 Json 数据各种 if else 的判断和校验,那该工具非常适合。它的官网:JSON Schema | The home of JSON Schema,先看一个简单的例子,假设我们有下面的 Schema:
{
"type": "object",
"properties": {
"first_name": { "type": "string" },
"last_name": { "type": "string" },
"birthday": { "type": "string", "format": "date" },
"address": {
"type": "object",
"properties": {
"street_address": { "type": "string" },
"city": { "type": "string" },
"state": { "type": "string" },
"country": { "type&