我完全不知道,因为这里没有一个适合的地方 . [1487417_,_1487418, oneOf ] .
oneOf
让's say that I'得到 ss1 和 ss2 子文件,分别定义 t1 和 t2 类型的元素 . 如何编写一个接受数组_1187425_(符合 ss1 )和另一个 t2 元素(符合 ss2 )的数组的模式?
ss1
ss2
t1
t2
items 关键字有一个特殊的格式 . 它可以是一个模式数组,而不是作为模式的值 . 当以这种方式使用 items 时,数组中的项必须符合 items 模式数组中的相应模式 . 这是一个工作示例,假设t1 = string,t2 =整数 .
items
{ "type": "array", "items": [ { "$ref": "#/definitions/ss1" }, { "$ref": "#/definitions/ss2" } ], "minItems": 2, "maxItems": 2, "definitions": { "ss1": { "type": "string" }, "ss2": { "type": "integer" } } }
1 回答
items
关键字有一个特殊的格式 . 它可以是一个模式数组,而不是作为模式的值 . 当以这种方式使用items
时,数组中的项必须符合items
模式数组中的相应模式 . 这是一个工作示例,假设t1 = string,t2 =整数 .