Skip to content

Cannot write metadata to root object #85

@drewcassidy

Description

@drewcassidy

Describe the Bug

I have the following call. The input items are batched so "VersionFIle" at this point is a single item. it does have the "a" metadata variable

    <JsonPoke Content="{}" Query="$" Value="@(VersionFile)" Properties="a">
      <Output TaskParameter="Content" PropertyName="_JSON"/>
    </JsonPoke>

Expected Behavior

Output json would be

{
  "a": "Value of a"
}

Exception with Stack Trace

0>/Users/drewcassidy/Code/Shabby/KSPBuildTools/KSPCommon.targets(89,5): Error MSB4018 : The "JsonPoke" task failed unexpectedly.
System.InvalidOperationException: The parent is missing.
   at Newtonsoft.Json.Linq.JToken.Replace(JToken value)
   at JsonPoke.Execute() in /_/src/JsonPoke/JsonPoke.cs:line 207
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

Version Info

JsonPoke 1.2.0

Additional Info

using a different query like "$.thing" does succeed

Back this issue
Back this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions