【发布时间】:2023-03-22 00:39:02
【问题描述】:
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "http://example.com/example.json",
"type": "object",
"required": [
"FileID",
"MString",
"desc",
"elements"
],
"properties": {
"FileID": {
"type": "string"
},
"MString": {
"type": "string"
},
"desc": {
"type": "string"
},
"elements": {
"type": "array",
"items": {
"type": "object",
"required": [
"Mytype",
"filename",
"compression"
],
"properties": {
"Mytype": {
"type": "string"
},
"filename": {
"type": "string"
},
"compression": {
"type": "string"
}
}
}
}
}
}
我想在这个模式中添加一个条件(如果 Mytype == "abc")那么 "filename" 只能是 "tutor.txt"。请有人帮我写这个在模式中添加这个条件。我尝试了很多方法,但总是给出一些错误。提前致谢。
【问题讨论】:
标签: javascript python json.net