Fix JsonMatcher (parsing DateTimeOffset) (#358)

* .

* JObject Parse

* JsonUtils.Parse

* fix code comments
This commit is contained in:
Stef Heyenrath
2019-10-09 11:16:39 +02:00
committed by GitHub
parent b2167f85ae
commit 7789f94737
4 changed files with 45 additions and 9 deletions

View File

@@ -1,8 +1,9 @@
using System;
using System.Linq;
using HandlebarsDotNet;
using HandlebarsDotNet;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
using WireMock.Util;
using WireMock.Validation;
namespace WireMock.Transformers
@@ -56,7 +57,7 @@ namespace WireMock.Transformers
switch (arguments[0])
{
case string jsonAsString:
valueToProcess = JObject.Parse(jsonAsString);
valueToProcess = JsonUtils.Parse(jsonAsString);
break;
case JObject jsonAsJObject:
@@ -67,7 +68,7 @@ namespace WireMock.Transformers
throw new NotSupportedException($"The value '{arguments[0]}' with type '{arguments[0]?.GetType()}' cannot be used in Handlebars JsonPath.");
}
return (valueToProcess, (string) arguments[1]);
return (valueToProcess, (string)arguments[1]);
}
}
}