KevinDockx / JsonPatch

JSON Patch (JsonPatchDocument) RFC 6902 implementation for .NET
MIT License
173 stars 29 forks source link

Nuget package breaks if Newtonsoft.Json 6 isn't around #65

Closed bob0the0mighty closed 7 years ago

bob0the0mighty commented 7 years ago

I ran into an issue at work where JsonPatch was failing if newtonsoft versions other than 6 were being used. I was able to build a local package with the dependency set in nuget spec to address the problem.

Here's my modified nuspec file:

<?xml version="1.0"?>
<package >
  <metadata>
    <id>$id$</id>
    <version>$version$</version>
    <title>Json Patch (RFC 6902) support for .NET (Portable)</title>
    <authors>Kevin Dockx (Marvin)</authors>
    <owners>Kevin Dockx (Marvin)</owners>
    <projectUrl>https://github.com/KevinDockx/JsonPatch</projectUrl>
      <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <description>JSON Patch (https://tools.ietf.org/html/rfc6902) defines a JSON document structure for expressing a sequence of operations to apply to a JavaScript Object Notation (JSON) document; it is suitable for use with the HTTP PATCH method. The "application/json-patch+json" media type is used to identify such patch documents.

One of the things this can be used for is partial updates for REST-ful API's, or, to quote the IETF: "This format is also potentially useful in other cases in which it is necessary to make partial updates to a JSON document or to a data structure that has similar constraints (i.e., they can be serialized as an object or an array using the JSON grammar)."

That's what this package is all about. Web API supports the HttpPatch method, but there's currently no implementation of the JsonPatchDocument in .NET, making it hard to pass in a set of changes that have to be applied - especially if you're working cross-platform and standardization of your API is essential.

Have a look at the project site for the current status of this package and to learn how to get started.</description>
    <summary>JSON Patch (RFC 6902) support for .NET to easily allow and apply partial REST-ful service (through Web API) updates from any client (portable class library)</summary>
    <copyright>Copyright 2014, 2015</copyright>
    <tags>Web API WebAPI HttpPatch Json JsonPatch Partial Update ASP .NET</tags>
    <dependencies>
            <dependency id="Newtonsoft.Json" version="(6.0,)" />
    </dependencies>
  </metadata>
</package>
KevinDockx commented 7 years ago

Thanks for this. Currently, v6.04 or higher should work. If you still experience this issue, feel free to re-open.