Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know of a Perl module to create rfc6902 compliant JSON patch files when given two JSON objects to compare?

Replies are listed 'Best First'.
Re: Create JSON patch
by wjw (Priest) on Oct 06, 2017 at 18:52 UTC

    I know nothing of this, and so was curious... I found the following which refers to both rfc6901 and rfc6902. Hope it might help....

    JSON::Pointer

    Update

    ...and maybe even ...Data::Compare?

    ...the majority is always wrong, and always the last to know about it...

    A solution is nothing more than a clearly stated problem...

Re: Create JSON patch
by LanX (Saint) on Oct 06, 2017 at 18:50 UTC
      That module applies patches but does not create them.
        Can this even be easily done ? ? ?

        I see a lot of operations which indicate strongly, that there is more than one possible solution.

        • Add
        • Remove
        • Replace
        • Copy
        • Move

        So which algorithm should be used to decide, if an element has to be "moved" instead of being "replaced" ...

        Cheers Rolf
        (addicted to the Perl Programming Language and ☆☆☆☆ :)
        Je suis Charlie!