hurl
hurl copied to clipboard
hurl captures get object and use next variable
Problem to solve
hurl captures get object and use next api
roles api response
{
"success":true,
"result":[
{
"uuid":"1",
"name":"Reviewer",
"created_at":"2024-05-29T04:09:40Z",
"updated_at":"2024-07-10T12:20:46Z",
"xxx": ....
},
{
"uuid":"2",
"name":"Admin",
"created_at":"2024-05-29T04:09:40Z",
"updated_at":"2024-07-10T12:20:46Z",
"xxx": ....
}
]
}
captures get values
GET {{openapi_server_v1}}/roles
Content-Type: application/json
Authorization: Bearer {{access_token}}
HTTP 200
[Captures]
admin: jsonpath "$.result[?(@.name=='Admin')]" nth 0
reviewer: jsonpath "$.result[?(@.name=='Reviewer')]" nth 0
[Asserts]
jsonpath "$.success" == true
get values and next api use
POST {{openapi_server_v1}}/api_tokens
Content-Type: application/json
Authorization: Bearer {{access_token}}
{
"name": "admin",
"role": {{admin}}
}
HTTP 201
[Asserts]
jsonpath "$.success" == true
error info
Hi there, is this issue fixed? I encountered the same issue, any other solutions to prevent this error?
Hi @seyoatda
Currently templating of a captured object is not supported, the alternative is to capture individual property and render it where you need it