3
我想为我的用例构建一个JSON schema,其中我有一个单独的文件中的字符串枚举并希望从我的模式中引用该枚举。我怎样才能做到这一点。Json Schema - 使用参考枚举
示例模式:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"card": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"value": {
"type": "string",
"enum": {"$ref" : "reference to a file having list of enums"}
//I want to refer to a specific enum array (say value1's array)
}
}
}
},
"required": [
"card"
]
}
枚举文件是这样的:
{
"value1": [..],
"value2": [..]
....
}