【发布时间】:2019-09-18 15:50:53
【问题描述】:
JSON-Schema 中是否有 elif/elseif/switch 语句?我好像不在。
【问题讨论】:
标签: if-statement switch-statement json-schema-validator
JSON-Schema 中是否有 elif/elseif/switch 语句?我好像不在。
【问题讨论】:
标签: if-statement switch-statement json-schema-validator
您可以将“allOf”与 if 语句的对象列表一起使用
"allOf": [
{
"if": {...},
"else": {...}
},
{
"if": {...},
"else": {...}
}
]
请注意,此列表需要位于它所引用的项目的对象级别!
来源:https://json-schema.org/understanding-json-schema/reference/conditionals.html
【讨论】: