验证"#number"到实数的架构的问题



问题:

名称"httpCode"(MAP:MAP)的$|不等于|匹配失败

$.httpCode|数据类型不匹配(STRING:NUMBER)'#number'206

架构:

  • def SchemaAccountProducts="quot"{"httpCode":"数字";,"httpMessage":"字符串";,"时间戳":"字符串";,"更多信息":"字符串";,"userFriendlyError":"字符串";,"响应":{"cardList":"(SchemaCardList)";,"accountList":"(SchemaAccountList)";,"creditList":"(SchemaCreditList)";}}"quot">

响应

{"httpCode":206,"httpMessage":"PARTIAL_CONTENT",

如何用"#数字"??

从错误消息中可以清楚地看出,实际响应JSON中的206是字符串,而不是数字。如果你是对的,空手道有一个严重的错误,所以请按照这个过程:https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue

更可能的是,你的问题是不完整的。

为了证明空手道的行为,试试这个简单的测试:

* def response = { httpCode: 206 }
* match response == { httpCode: '#number' }

您可以将206更改为'206'并查看差异。

最新更新