【发布时间】:2022-10-13 12:37:43
【问题描述】:
当一个属性有const 或enum 时,证明type 有什么好处或坏处?
{
"type": "object",
"properties": {
"has_car": {
"title": "Do you have a car?",
"enum": ["yes", "no"],
"type": "string",
"$comment": "Do I need type here?"
},
"car_brand": {
"title": "What's your car brand?",
"type": "string"
},
"terms": {
"title": "I accept my car terms",
"const": "acknowledged",
"$comment": "Do I need type here?"
}
}
}
【问题讨论】:
标签: jsonschema json-schema-validator