fge/json-patch — pull request #10 by hnguyen08 (2014-03-24 22:58:23+00:00)
Title: add "create" operation

I'd like to extend JSON Patch and add a new "create" operation. It is exactly like "add", except it will not replace an existing value at the requested path. It will be useful in situations in where a client wants to ensure that they are not overwriting a value set by another client.

This was a suggestion from an email thread with the [RFC6902](https://tools.ietf.org/html/rfc6902) authors:
>I think you've got it right; you can't do it in a fine-grained way with json-patch. Of course, you could use HTTP conditionals (e.g., If-Match), but that's more coarse-grained.
>If you want to do this right now, I think the best thing to do would be to define a new operation and then use a new media type to differentiate between it and JSON Patch.
>I'd be interested in starting a new version of json patch if we can get enough experience with this one to make it worthwhile...

Although it deviates from the RFC, I think it would be useful for others to use, perhaps in a custom JsonPatch implementation as you mentioned in https://github.com/fge/json-patch/issues/9.

Let me know what you think!