You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My script that works in hurl version 3.0.1 throws now:
"""
error: Unrenderable variable
--> client_setup/get_clientId.hurl:11:60
|
11 | GET {{url}}/auth/clients/{{client_id}}/client-secret
| ^^^^^^^^^ variable <client_id> with value [THIS_IS_AN_ID] can not be rendered
|
"""
Steps to reproduce
add
"""
[Captures]
client_id: jsonpath "$[?(@.name=='{{my_client}}')].id"
"""
to a step that returns an array with multiple objects that contain id and name
this should return the id of client "my_client" as follows:
THIS_IS_AN_ID
returns as follows:
[THIS_IS_AN_ID]
##maybe a solution
I think the fix for #1469 could have introduced this error.
I can't find any way to make my configurations work with version higher than 4.0.0
The text was updated successfully, but these errors were encountered:
Starting with Hurl 4.0.0, we've slighty changed JSONPath evaluation to be more correct. When your JSONPath contains a filter (like ?(@.name=='{{my_client}}')), the Hurl queries will return a collection. You can have more details about this change here https://hurl.dev/blog/2023/06/30/announcing-hurl-4.0.0.html#jsonpath-change
In your case, you can extract an item from the collection with nth filter:
....
[Captures]
client_id: jsonpath "$[?(@.name=='{{my_client}}')].id" nth 0
GET {{url}}/auth/clients/{{client_id}}/client-secret
We have done this change to deal with edge cases and to be more consistant with JSONPath spec
What is the current bug behavior?
My script that works in hurl version 3.0.1 throws now:
"""
error: Unrenderable variable
--> client_setup/get_clientId.hurl:11:60
|
11 | GET {{url}}/auth/clients/{{client_id}}/client-secret
| ^^^^^^^^^ variable <client_id> with value [THIS_IS_AN_ID] can not be rendered
|
"""
Steps to reproduce
add
"""
[Captures]
client_id: jsonpath "$[?(@.name=='{{my_client}}')].id"
"""
to a step that returns an array with multiple objects that contain id and name
this should return the id of client "my_client" as follows:
THIS_IS_AN_ID
returns as follows:
[THIS_IS_AN_ID]
##maybe a solution
I think the fix for #1469 could have introduced this error.
I can't find any way to make my configurations work with version higher than 4.0.0
The text was updated successfully, but these errors were encountered: