AFAIK ключ $data
был удален в черновике 07 схемы JSON, поэтому мне интересно, как приблизиться к Подтверждению пароля
Я использую Newtonsoft JSON Schema Validator
, и у меня есть следующая схема, но я получил следующие ошибки:
Ошибка:
![](https://i.stack.imgur.com/5Syph.png)
Сообщение об ошибке ![](https://i.stack.imgur.com/fxF2V.png)
{
"$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"
}
]
}