0
我试图创建一个JSON模式为现有的JSON文件看起来是这样的一个名为“类型”的属性类型定义:创建使用JSON模式
{
"variable": {
"name": "age",
"type": "integer"
}
}
在架构,我想为确保type
属性的值为string
或integer
:
{
"variable": {
"name": "string",
"type": {
"type": "string",
"enum": ["string", "integer"]
}
}
}
不幸的是它吹了消息:ValidationError {is not any of [subschema 0]...
。
我读过JSON模式中有“无保留字”,所以我假设一种类型是有效的,假设我正确地声明它?