This message was deleted.
# help
s
This message was deleted.
👀 1
m
I reported it as a regression: https://github.com/wiremock/wiremock/issues/2533 Simpler example:
"tracking": "{{{array 123 456}}}",
which generates
"tracking":"[123, 456]"
which is not illegal, but incorrect. Just
"tracking":[123, 456]
is expected.
g
@Marcin Z. Thank you for adding detailed info. I tried the reproduction steps. Was this ever working in any previous version? Another note : If you remove the quote from the template, it does not appear in the response. (The json becomes invalid, but it gives the result)
Copy code
{
      "id": "{{request.pathSegments.[4]}}",
      "type": "external",
      "tracking": {{jsonPath request.body '$.tracking'}}
}
m
Thanks @Gunjan Basak for taking a look. I tried without quoting, but Wiremock 3.3.1 fails with:
Caused by: java.lang.ExceptionInInitializerError: Exception com.github.tomakehurst.wiremock.standalone.MappingFileException: Error loading file /.../src/test/resources/mappings/updateOrderTracking.json:
Unexpected character ('{' (code 123)): was expecting double-quote to start field name
Regarding the past, there was definitely no error before, so it seemed work or Wiremock for some reasons was quietly ignoring the errors.
I've re-checked it with the 3.0.0-beta-10 and you were right.
"tracking":"[123, 456]"
is also generated. However, the error is not generated, maybe parsing with the JSON decoder was added after that (and we were asserting that particular in our tests).
👍 1
I wonder, if it is "fixable" with
jsonBody
?
🤔 1