mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-27 02:38:30 +02:00
Use RandomDataGenerator.Net 1.0.3.0 (#231)
* Include="RandomDataGenerator.Net" Version="1.0.3" * UndefinedBindingResult
This commit is contained in:
@@ -9,15 +9,15 @@ namespace WireMock.Transformers
|
||||
{
|
||||
internal static class HandleBarsJsonPath
|
||||
{
|
||||
public static void Register()
|
||||
public static void Register(IHandlebars handlebarsContext)
|
||||
{
|
||||
Handlebars.RegisterHelper("JsonPath.SelectToken", (writer, context, arguments) =>
|
||||
handlebarsContext.RegisterHelper("JsonPath.SelectToken", (writer, context, arguments) =>
|
||||
{
|
||||
(JObject valueToProcess, string jsonpath) = ParseArguments(arguments);
|
||||
(JObject valueToProcess, string jsonPath) = ParseArguments(arguments);
|
||||
|
||||
try
|
||||
{
|
||||
var result = valueToProcess.SelectToken(jsonpath);
|
||||
var result = valueToProcess.SelectToken(jsonPath);
|
||||
writer.WriteSafeString(result);
|
||||
}
|
||||
catch (JsonException)
|
||||
@@ -26,13 +26,13 @@ namespace WireMock.Transformers
|
||||
}
|
||||
});
|
||||
|
||||
Handlebars.RegisterHelper("JsonPath.SelectTokens", (writer, options, context, arguments) =>
|
||||
handlebarsContext.RegisterHelper("JsonPath.SelectTokens", (writer, options, context, arguments) =>
|
||||
{
|
||||
(JObject valueToProcess, string jsonpath) = ParseArguments(arguments);
|
||||
(JObject valueToProcess, string jsonPath) = ParseArguments(arguments);
|
||||
|
||||
try
|
||||
{
|
||||
var values = valueToProcess.SelectTokens(jsonpath);
|
||||
var values = valueToProcess.SelectTokens(jsonPath);
|
||||
if (values != null)
|
||||
{
|
||||
options.Template(writer, values.ToDictionary(value => value.Path, value => value));
|
||||
|
||||
Reference in New Issue
Block a user