【发布时间】:2019-07-02 20:01:41
【问题描述】:
AFAIK $data 键已在 JSON 模式的草案 07 中删除,所以我想知道如何处理确认密码
我正在使用Newtonsoft JSON Schema Validator,并且我有以下架构,但我得到了下一个错误:
错误:
{
"$schema": "http://json-schema.org/draft-07/schema",
"definitions": {
"SignIn": {
"properties": {
"Password": {
"$id": "SignInPassword",
"maxLength": 15,
"minLength": 6,
"type": "string"
},
"Username": {
"oneOf": [
{
"format": "email",
"type": "string"
},
{
"pattern": "^\\+?[1-9]\\d{1,14}$",
"type": "string"
}
]
}
},
"required": [
"Password",
"Username"
],
"type": "object"
}
},
"allOf": [
{
"$ref": "#/definitions/SignIn"
},
{
"properties": {
"ConfirmPassword": {
"const": {
"$data": "1/Password"
},
"minLength": 6,
"type": "string"
}
},
"required": [
"ConfirmPassword"
],
"type": "object"
}
]
}
【问题讨论】:
标签: jsonschema