Hi Team , I received this error when I tried to cr...
# help
a
Hi Team , I received this error when I tried to create a stub which has dynamic response based on the value of a query parameter sent in the request. Here's the Stub creation request :
Copy code
curl --request POST \   --url <http://localhost:8080/__admin/mappings> \   --header 'content-type: application/json' \   --data '{   "priority": 15,   "request": {     "method": "GET",     "urlPath": "/reports/awb/tracking",     "queryParameters": {       "clientId": {         "equalTo": "323245"       },       "language": {         "equalTo": "en"       },       "awb[]": {         "matches": ".+"       }     }   },   "response": {     "status": 200,     "headers": {       "Content-Type": "application/json"     },     "jsonBody": {         "status": "success",         "data": [           {             "awbNumber": "{{request.query.awb[0]}}",             "content": "test",             "confirmation": {               "name": "test",               "date": "2023-03-06 13:58"             },             "returnAwbNumber": null,             "events": [               {                 "id": "H4",                 "name": " Shipment sorted on the belt",                 "location": "Bucharest",                 "date": "2023-03-01 04:46:46"               },               {                 "id": "H10",                 "name": " Shipment in transit towards the destination warehouse ",                 "location": "Bucharest",                 "date": "2023-03-01 05:19:10"               }             ]           }         ]       },     "transformers": [       "response-template"     ]   },   "persistent": true }'
I have deployed Wiremock using Flux (kubernetes) and I am using the below arguments :
Copy code
args:
  - "--no-request-journal"
  - "--disable-request-logging"
  - "--max-template-cache-entries=50"
  - "--local-response-templating"
  - "--root-dir"
  - "/mnt/azure"
not sure why "--local-response-templating" does not work in this case. Could you please let me know how I can fix this 🙂 .
l
Can’t see anything off the top of my head. Will try and replicate it when I get home
Could this be because your response template should be
{{request.query.awb.[0]}}
?