我有一个GET请求,该请求以以下格式返回了响应:
"http://wso2.org/claims/role": [
Application/API_ADMIN_SSO",
],
"http://wso2.org/claims/applicationtier": "Unlimited",
"http://wso2.org/claims/keytype": "PRODUCTION",
"http://wso2.org/claims/version": "v1",
"iss": "wso2.org/products/am"
如何匹配这些字段,因为如果这样做
And match response.http://wso2.org/claims/applicationtier == "PRODUCTION"
它抛出错误并指出路径不存在。
答案 0 :(得分:3)
* def response = { "http://wso2.org/claims/applicationtier": "PRODUCTION" }
* match response['http://wso2.org/claims/applicationtier'] == 'PRODUCTION'