------------ Josn schema -----------
{
"type": "object",
"properties": {
"street_address": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
}
},
"required": [
"street_address"
],
"additionalProperties": false
}
Run Code Online (Sandbox Code Playgroud)
在上面的模式中,我想在城市和州之间创建一个选择.无论是城市还是州都可以来json.所以json下面会无效
{
"street_address": "abc",
"city": "anv",
"state": "opi"
}
Run Code Online (Sandbox Code Playgroud)
以下一个应该是有效的
{
"street_address": "abc"
}
Run Code Online (Sandbox Code Playgroud)
要么
{
"street_address": "abc",
"city": "anv"
}
Run Code Online (Sandbox Code Playgroud)
要么
{
"street_address": "abc",
"state": "opi"
}
Run Code Online (Sandbox Code Playgroud)
有人可以帮我修改上面的架构来完成目标.