以下JSON
作为响应-
{
"result": {
"status": "ERROR",
"error": {
"errorCode": "x500",
"errorType": "string500",
"errorMessage": "string700"
}
}
}
我可以成功提取以下变量-
<JSONPayload>
<Variable name="result">
<JSONPath>$.result</JSONPath>
</Variable>
<Variable name="status">
<JSONPath>$.result.status</JSONPath>
</Variable>
<Variable name="errorCode">
<JSONPath>$.result.error.errorCode</JSONPath>
</Variable>
<Variable name="errorType">
<JSONPath>$.result.error.errorType</JSONPath>
</Variable>
<Variable name="errorMessage">
<JSONPath>$.result.error.errorMessage</JSONPath>
</Variable>
</JSONPayload>
但是,当我尝试从error
对象中提取完整的JSON
对象时,它显示无法执行ExtractVariables] >>
<Variable name="error">
<JSONPath>$.result.error</JSONPath>
</Variable>
以下JSON用作响应-{“结果”:{“状态”:“错误”,“错误”:{“错误代码”:“ x500”,“错误类型”:“字符串500”,“错误消息”: “ string700”}}} ...
选择error
以外的其他名称,因为它是Apigee
平台中的保留字,因此显示失败消息。