jsonschema
jsonschema
1 Json Schema 是什么?
Json Schema 定义了一套词汇和规则,这套词汇和规则用来定义 Json 元数据,且元数据也是通过 Json 数据形式表达的。
Json 元数据定义了 Json 数据需要满足的规范,规范包括成员、结构、类型、约束等。{
"type": "object",
"properties": {
"city": { "type": "string" },
"number": { "type": "number" },
"user": {
"type": "object",
"properties": {
"name" : {"type": "string"},
"age" : {"type": "number"}
}
}
}
}2 Json Schema 的用途是什么?
3 怎么写 Json Schema 文件?
4 Python 中怎么使用 Json Schema Validator?
4.1 Flask 中使用 jsonschema
4.2 Butterfly 中使用 jsonschema
4.2.1 xingqiao
Last updated