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
A clear and concise description of what the bug is.
Expected behavior:
A clear and concise description of what you expected to happen.
Working unit-test
[Fact]publicvoidSelectToken_WithComplexTemplate(){// ArrangeconststringrequestAsJson=""" { "bodyAsJson": { "pricingContext": { "market": "US" } } } """;varrequest=JsonConvert.DeserializeObject(requestAsJson);// Use single quotes for the JsonPath else it will be parsed correctly by Handlebars.Netvaraction=_handlebarsContext.Compile("{\r\n\"market\": \"{{JsonPath.SelectToken bodyAsJson '$.pricingContext.market'}}\",\r\n\"languages\": \"en\"\r\n}");// Actvarresult=action(request);// Assertvarexpected=""" { "market": "US", "languages": "en" } """;result.Should().Be(expected);}
StefH
changed the title
Using a custom helper in a esacped string, and escaping a string argument to that helper is not handled correctly by Handlebars.Net
Using a custom helper in a escaped string, and escaping a string argument to that helper is not handled correctly by Handlebars.Net
May 29, 2024
Describe the bug
A clear and concise description of what the bug is.
Expected behavior:
A clear and concise description of what you expected to happen.
Working unit-test
Using escaped double quotes does not work:
"{\r\n \"market\": \"{{JsonPath.SelectToken bodyAsJson \\\"$.pricingContext.market'}}\\\",\r\n \"languages\": \"en\"\r\n}"
Exception:
System.NullReferenceException : Object reference not set to an instance of an object.
Linked to
WireMock-Net/WireMock.Net#1108
The text was updated successfully, but these errors were encountered: