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
[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);}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/WireMock.Net#1108
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/WireMock.Net#1108