APIs in the wild using RFC-6902?

488 views
Skip to first unread message

MendeleyStack

unread,
Sep 3, 2015, 12:28:49 PM9/3/15
to API Craft
Hello Everyone, 

In short - we have an API and we use the good old HTTP PATCH method for applying partial updates. Its out in our version 1 and we have adopted it as a standard. 

But there is always one maverick team -  they have decided to go down the route of using RFC-6902 for their particular set of APIs. 

Some questions: 
  • Can you show me any APIs out in the wild who are using this? I would like to seek some inspiration. 
  • Are their any particular drawbacks to this approach? 
  • Is their a wrong way of doing it? 
  • When should you not even consider it? 

Finding it difficult to find a massive amount of information on the web. I have read this etc http://williamdurand.fr/2014/02/14/please-do-not-patch-like-an-idiot/ 

Looking for some pointers as I don't want to force a team to use PATCH for consistency sake if it's just not right for them. However, I'm not finding any concert examples of this being adopted.

Thank you. 


daniel carli

unread,
Sep 3, 2015, 12:47:03 PM9/3/15
to api-...@googlegroups.com
Hi Mendeley,

Not long time ago, we try to use RFC-6902 to do partials updates, but, we dont find any other apis using it and the implementation its not easy. Now we're using JSON merge patch and we have nothing to complain about. The implementation is more easy and the usage is more intuitive.

I would like to see some implementation using JSON Patch but for now, im running out of lucky.

Best regards,

Daniel


--
You received this message because you are subscribed to the Google Groups "API Craft" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-craft+...@googlegroups.com.
Visit this group at http://groups.google.com/group/api-craft.
For more options, visit https://groups.google.com/d/optout.



--
Daniel Carli

Jørn Wildt

unread,
Sep 3, 2015, 3:49:32 PM9/3/15
to api-...@googlegroups.com
We are using JSON-Patch for all partial updates in our API (which is an internal API for working with document and records management). Now-a-days I would have chosen JSON-Merge as it seems more "business API friendly" as opposed to JSON-Patch which I find a bit too JSON-document oriented.

/Jørn

Steve Klabnik

unread,
Sep 3, 2015, 4:15:50 PM9/3/15
to api-...@googlegroups.com
JSON API has an extension that uses RFC 6902.
http://jsonapi.org/extensions/jsonpatch/

MendeleyStack

unread,
Sep 4, 2015, 12:28:13 PM9/4/15
to API Craft
Thank you everyone. Will let you know how we get on. 

My feeling is I want to maintain consistency in our APIs and look into JSON patching and merging for the next version. 

 

John Morey

unread,
Sep 20, 2015, 10:21:57 PM9/20/15
to API Craft
@Mendeley,

The TMForum REST APIs use JSON PATCH..

Regards,

John

Erik Azar

unread,
Sep 21, 2015, 3:59:17 PM9/21/15
to API Craft
Mendeley,

I've implemented JSON PATCH (RFC-6902) in our APIs and it works well. I would provide an example, but our external API Gateway provider still hasn't managed to get PATCH support working, so I've not updated our public documentation with use cases. Today we only use it internally for our own applications.

The only drawback I've experienced is working with collections. Adding items to a collection works fine, however, if you're updating/replacing/deleting items, ensure you can uniquely identify the item via an id of some type.

If I were to implement it today though, I would look at using JSON Merge Patch (RFC-7396)  . I feel the JSON Merge Patch document is more approachable for the client, and I *think* I like their approach to working with arrays, where you cannot update individual items, you need to send the entire array representation.

-Erik
 

On Thursday, September 3, 2015 at 12:28:49 PM UTC-4, MendeleyStack wrote:
Reply all
Reply to author
Forward
0 new messages