用于嵌套结构验证的空数组的模式验证

Schema validation of empty array for nested structure verification

我正在使用 Karate 框架(最新版本 0.9.6)开发 POC,我遇到了以下问题:

 * match each response.bar contains { id:"#uuid ? _ != ''", name: "#notnull", foo: "#[] #object"}

我注意到,当 foo 是一个空数组时,它不会失败。 如果数组为空,是否可以在上述步骤中添加一个 length 验证以失败?

提前致谢。

是的,阅读文档:https://github.com/intuit/karate#schema-validation

* match each response.bar contains { id:"#uuid ? _ != ''", name: "#notnull", foo: "#[_ > 0] #object"}