couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sleepnova <wanpee...@gmail.com>
Subject Re: JSON-Patch
Date Thu, 21 Apr 2011 03:35:03 GMT
Maybe it's viable to use different Content-Type to switch different state
transition formates. (PATCH or ACTION verb)

For example:
   patch
   json
   javascript

Each one has it's own advantages on describing state transfer.
For example, it's not easy to create or apply a text (or binary) patch with
in a browser environment.

2011/4/21 Paul Davis <paul.joseph.davis@gmail.com>

> Skimming RFC3284 it appears to be byte based which seems quite
> incompatible with couchdb internals.
>
> On Wed, Apr 20, 2011 at 5:37 PM, Robert Newson <robert.newson@gmail.com>
> wrote:
> > supporting RFC 3284 format for PUT has been proposed before, and it's
> generic.
> >
> > B.
> >
> > On 20 April 2011 21:55, sleepnova <wanpeebaw@gmail.com> wrote:
> >> A sudo patch for demonstration.
> >>
> >> if(doc._rev=="07769cff70767095e4fb525dc9000b6e"){
> >>   //Put your patch here
> >> }
> >>
> >> I think above patch would be idempotent even when add or remove an array
> >> element based on an index.
> >>
> >> 2011/4/21 sleepnova <wanpeebaw@gmail.com>
> >>
> >>> A patch which checks document version number might solve this problem.
> >>> similar to a git commit log
> >>>
> >>>
> >>> 2011/4/21 Aurélien Bénel <aurelien.benel@utt.fr>
> >>>
> >>>> Dear Paul,
> >>>>
> >>>> > On the other hand, there's nothing inherently wrong with the PATCH
> verb
> >>>>
> >>>> True, PATCH could be idempotent... It just depends on your patch
> format.
> >>>>
> >>>> I just had a look at your patch operations specification:
> >>>> - When you add or remove a key/value, this is idempotent.
> >>>> - However, when you add or remove an array element based on an index,
> this
> >>>> is not.
> >>>>
> >>>>
> >>>> Regards,
> >>>>
> >>>> Aurélien
> >>>
> >>>
> >>> --
> >>> - sleepnova
> >>>
> >>
> >> --
> >> - sleepnova
> >>
> >
>



-- 
- sleepnova

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message