我在架构中有两个属性,它们都是数组。我想比较它们的长度相等。
例如:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"thing": {
"type": "object",
"properties": {
"fields": {
"type": "array",
"items": {}
},
"values": {
"type": "array",
"items": {}
}
},
"required": ["fields", "values"]
}
}
}
Run Code Online (Sandbox Code Playgroud)
{
"thing": {
"fields:": ["age", "sex", "location"],
"values:": [25, "Male", "Cape Town"]
}
}
Run Code Online (Sandbox Code Playgroud)
我想要比较模式中字段和值的长度相同。我该怎么做?