Open bbarry opened 4 years ago
We've moved this issue to the Backlog milestone. This means that it is not going to happen for the coming release. We will reassess the backlog following the current release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources.
Is your feature request related to a problem? Please describe.
The methods of
JsonPatchDocument
accept stringpath
parameters which each accept strings with no additional validations.In order to build various patches a user must build these strings appropriately. In my experience that often means joining a significant number of small strings together repeatedly with something like
var path = prefix + "/" + Utilities.EncodeForJsonPointer(pathitem);
.Often I have paths where highly accessed short constant string tokens are used repeatedly and I've probably made some poor decisions in how to lay my code out to efficiently produce appropriate responses.
For example I might have a controller method that returns a document like this:
My utility method here is encoding the property according to https://tools.ietf.org/html/rfc6901, effectively:
Describe the solution you'd like
It would be nice if there was an easy to use api that provided some guidance on how to make these things.
Having a type that is not
string
in a common namespace that a library author or application dev might reasonably be expected to have at hand would encourage coupling to the improved type and discourage fixating on this primitive form.Additional context
At the very least
JsonPatchDocument
utilizes string paths that are expected to be in a well known format yet I cannot find any documentation on starting from https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.jsonpatch.jsonpatchdocument if I didn't already know what I was doing with it.