我们可以强制类型对象的空属性如下:
{
"description": "voice mail record",
"type": "object",
"additionalProperties": false,
"properties": {}
}
Run Code Online (Sandbox Code Playgroud)
为解释在这里.
现在我要验证属性哪个
执行非空虚(第4点)是我无法猜测的.这与执行空虚有些相反,如上例所示.我当前的json架构摘录如下所示:
"attribute":
{
"type": "object",
"additionalProperties": { "type": ["string","number","integer"] }
}
Run Code Online (Sandbox Code Playgroud)
但上面并没有强制执行非空虚.我怎么能做到这一点?