https://linen.dev logo
#help
Title
# help
m

Mario Wolf

08/24/2023, 2:04 PM
Hello, I have an url with a query parameter with an '.' If I follow the json examples I don't get the value of that query parameter. I configured the request: "request": { "method": "GET", "urlPathPattern": "/nevisidm/api/core/v1/(.*)/users", "queryParameters": { "property.correlation_id": { "matches": "[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}" } } }, "response": { "status": 200, "bodyFileName": "search_users_successful.json", "headers": { "Content-Type": "application/json" }, "transformers": [ "response-template" ] } In the search_users_successful.json I configured on line of the response like this:
"correlation_id": "{{lookup request.query 'property.correlation_id'}}"
In the response of the
GET localhost:8082/nevisidm/api/core/v1/100/users?property.correlation_id=70ffb498-bda3-42af-889a-867156e151f6
I receive instead of the ID the following:
"correlation_id": "{property.correlation_id=70ffb498-bda3-42af-889a-867156e151f6}"
. There is these brackets {} and the prefix
property.correlation_id=
I want to get rid of.
t

Tom

08/24/2023, 2:49 PM
Hi Mario, this seems to be a genuine limitation of the
lookup
helper, in that it tries to resolve the query param key as if addressing a nested object. Here’s a workaround:
Copy code
{{#each request.query}}{{#eq @key 'property.correlation_id'}}{{{this}}}{{/eq}}{{/each}}
m

Mario Wolf

08/24/2023, 2:51 PM
Great! That seams to work.
👍 1