You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an array in json: "elements": [ "1", "2", "3", "4" ]
I want to delete the last one: "elements/#[3]": ""
i get an error:
Transformation found: elements/#[3]:
Transforming file C:\BuildAgent\_work\16\s\manifest\manifest.json
##[error]System.Management.Automation.MethodInvocationException: Exception calling "Transform" with "4" argument(s): "Object reference not set to an instance of an object." ---> System.NullReferenceException: Object reference not set to an instance of an object.
at MagicChunks.Helpers.JsonExtensions.GetChildProperty(JContainer source, String name)
at MagicChunks.Documents.JsonDocument.UpdateTargetElement(JObject current, String targetElementName, String value)
at MagicChunks.Documents.JsonDocument.ReplaceKey(String[] path, String value)
at MagicChunks.Core.Transformer.Transform(IDocument source, TransformationCollection transformations)
at MagicChunks.Core.Transformer.Transform(String source, TransformationCollection transformations)
at MagicChunks.TransformTask.Transform(String type, String sourcePath, String targetPath, TransformationCollection transformation)
at CallSite.Target(Closure , CallSite , Type , Object , Object , Object , Object )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
I've also tried "#elements/[3]": "", fails too.
The text was updated successfully, but these errors were encountered:
Were you ever able to figure this out? I am encountering the same thing where I need to be able to change/delete a value in an single value array like yours.
I have an array in json:
"elements": [ "1", "2", "3", "4" ]
I want to delete the last one:
"elements/#[3]": ""
i get an error:
I've also tried
"#elements/[3]": ""
, fails too.The text was updated successfully, but these errors were encountered: