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
When using the JsonPath.SelectToken feature in the handlebar transformer, I get a null ref exception. The exception occurs in HandlebarsDotNet.Helpers.JsonPathHelpers.SelectToken(object, string). Decompiling shows that the value of the string parameter is "name\" including the backslash. If I remove the backslash then everything works but the backslash is just the escape character for the double-quote. if this is the good old ID10T or pebcak issue, then please close. My guess is it's an off-by-one in some string parsing.
Describe the bug
When using the JsonPath.SelectToken feature in the handlebar transformer, I get a null ref exception. The exception occurs in HandlebarsDotNet.Helpers.JsonPathHelpers.SelectToken(object, string). Decompiling shows that the value of the string parameter is
"name\"
including the backslash. If I remove the backslash then everything works but the backslash is just the escape character for the double-quote. if this is the good old ID10T or pebcak issue, then please close. My guess is it's an off-by-one in some string parsing.Expected behavior:
Handlebar transformation should function as described in example at https://github.com/WireMock-Net/WireMock.Net/wiki/Response-Templating#jsonpath.
Test to reproduce
ParseAsJToken(value, "SelectToken").SelectToken("name")
- evaluates correctlyParseAsJToken(value, "SelectToken").SelectToken("name\")
- evaluates to nullOther related info
Unit Test Class
response.json
The text was updated successfully, but these errors were encountered: