diff --git a/JUST.net/JsonTransformer.cs b/JUST.net/JsonTransformer.cs index 0530cf7..1a4a166 100644 --- a/JUST.net/JsonTransformer.cs +++ b/JUST.net/JsonTransformer.cs @@ -137,8 +137,9 @@ private void RecursiveEvaluate(ref JToken parentToken, IDictionary tokenToF } else if (token is JArray arr && parentToken.Parent != null) { - (parentToken.Parent as JProperty).Value = arr; + switch (parentToken.Parent.Type) + { + case JTokenType.Array: + parentToken.Replace(arr); + break; + case JTokenType.Property: + (parentToken.Parent as JProperty).Value = arr; + break; + default: + if (Context.IsStrictMode()) + { + throw new Exception($"don't know what to do with {token} and {parentToken.Type} parent!"); + } + break; + } } else { @@ -902,12 +917,12 @@ private object ParseApplyOver(IDictionary array, IDictionary - - + +