如何根据JSON模式中的多个条件来制定需要的字段?
如何根据2(或更多)其他属性的价值制作所需的属性?
例如,
{
"properties": {
"property1": {
"type": "string"
},
"property2": {
"type": "string"
}
"property3":{
"type": "string"
}
}
}
如何根据属性1和属性2的值制作属性3?
似乎就像我需要使用allof
,但是
"allOf": [
{
"if": {
...
},
"then": {
...
}},
"if": {
...
},
"then": {
...
}
]
当我真正需要的是一个的多个条件时,有多个
块。然后
块,然后
How can I make a property required based on the value of 2 (or more) other properties?
For instance,
{
"properties": {
"property1": {
"type": "string"
},
"property2": {
"type": "string"
}
"property3":{
"type": "string"
}
}
}
How can I make property3 required based on the values of property1 and property2?
It seems like I need to use allOf
, but
"allOf": [
{
"if": {
...
},
"then": {
...
}},
"if": {
...
},
"then": {
...
}
]
has multiple then
blocks when what I really need is multiple conditions for only one then
block.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论