[aerogear-dev] Data Sync: use of IETFs formats
Corinne Krych
corinnekrych at gmail.com
Mon Sep 8 08:20:58 EDT 2014
On 08 Sep 2014, at 14:04, Lukáš Fryč <lukas.fryc at gmail.com> wrote:
> Hey guys,
>
> I've recently encountered two standard formats that standardizes the HTTP PATCH, that could be important for formats we use for Data Sync features:
>
> json-patch
> http://tools.ietf.org/html/rfc6902
+1
Yeap I mentioned it too in theis thread
http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-Comparing-sync-in-Android-vs-other-platforms-td6617.html#a6637
some time ago
>
> Defines set of operations that you can do with JSON object such as: add, remove, replace, move, copy, replace, test.
>
> [
> { "op": "test", "path": "/a/b/c", "value": "foo" },
> { "op": "remove", "path": "/a/b/c" },
> { "op": "add", "path": "/a/b/c", "value": [ "foo", "bar" ] },
> { "op": "replace", "path": "/a/b/c", "value": 42 },
> { "op": "move", "from": "/a/b/c", "path": "/a/b/d" },
> { "op": "copy", "from": "/a/b/d", "path": "/a/b/e" }
> ]
>
> The structure of the patch is list of operations, not the document itself.
>
> We could actually rewrite DiffSync Server to use it (since it is very close to that format).
>
>
>
> json-merge-patch (draft)
> http://tools.ietf.org/html/draft-ietf-appsawg-json-merge-patch-0
>
> Defines a format where you send updated parts of the JSON Object itself in same structure as original object:
>
> e.g.: object:
>
> {
> "a": "b",
> "c": {
> "d": "e",
> "f": "g"
> }
> }
>
> patch:
>
> {
> "a":"z",
> "c": {
> "f": null
> }
> }
>
>
>
> Cheers,
>
> ~ Lukas
> _______________________________________________
> aerogear-dev mailing list
> aerogear-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/aerogear-dev
More information about the aerogear-dev
mailing list