[Feature Request]: Add JsonPeek and JsonPatch tasks #9260
Labels
backlog
blocked
Feature Request
Priority:2
Work that is important, but not critical for the release
triaged
Summary
Add support in MSBuild for handling JSON as structured data, roughly equivalent to the
XmlPeek
,XmlPoke
, andXslTransformation
tasks for XML.Background and Motivation
The "Command line evaluation of MSBuild properties" feature will output JSON and JSON has become at least as common as XML but is not supported in MSBuild code.
Proposed Feature
Create
JsonPeek
andJsonPatch
tasks using System.Text.Json.Like
XmlPeek
andXslTransformation
(and unlikeXmlPoke
), theJsonPeek
andJsonPatch
tasks should accept input content as either strings or files.JsonPeek
JsonPeek
would support querying JSON and would depend on a "location path" which should probably conform with the JSONPath Draft RFC. SQL Server has a definition for JSON Path Expressions that seems to follow the RFC and there is a JsonPath.Net implementation.JsonPeek
would be equivalent toXmlPeek
.JsonPatch
JsonPatch
would support modifying JSON and would depend on the JSON Patch Proposed Standard. There is a JsonPatch.Net implementation. JSON Patch support in ASP.NET uses Newtonsoft.Json.The
JsonPatch
task may be considered to be likeXslTransformation
. A weakness ofXmlPoke
is that it uses XPath to identify a node which it essentially can only replace. Because the patch document for JSON is generally simpler than an XSLT,JsonPatch
is probably sufficient as an equivalent for bothXmlPoke
andXslTransformation
.Alternative Designs
No response
The text was updated successfully, but these errors were encountered: