接口测试 请教 json schema 中,如何根据一个属性的不同取值情况去判断另一个属性的类型

donly · 2019年03月18日 · 854 次阅读

如有以下 json,当 salesPersonId 为 A,B 时,salesPersonOffice 只能取 A1,B1 等 String 类型,当 salesPersonId=C 时,salesPersonOffice 也只能为 null.
知道有一个 dependencies 属性,但是尝试了几次都不行,不知道具体应该怎么写。

[
{
"salesPersonId": "A",
"salesPersonOffice": "A1"
},
{
"salesPersonId": "B",
"salesPersonOffice": "B1"
},
{
"salesPersonId": "C",
"salesPersonOffice": null
}
]

暫無回覆。
需要 登录 後方可回應,如果你還沒有帳號按這裡 注册