Skip to content

Is there any way to return a JSON difference object instead of delta alone? #189

@brydko

Description

@brydko

Hello. I would like to obtain an actual difference between 2 JSON with same schema.

JSON1 ->

{"key1":[{"prop1":"a","name":"a","status":"active","values":["val1"]}],
 "key2":[{"property":"oneProperty","name":"name","type":"someType"},
{"property":"differentProperty","name":"someOtherName","type":"someOtherType"},]};

JSON2 ->

{"key1":[{"prop1":"a","name":"a","status":"active","values":["val1"]}],
 "key2":[{"property":"oneProperty","name":"name","type":"someType"}]};

Delta is correctly obtained ->

 {"key2":{"_t":"a","_1":[{"property":"differentProperty","name":"someOtherName","type":"someOtherType"},0,0]}}

What I am actually trying to get is the actual difference itself (I don't care if some property was added or deleted). So the result I'm expecting is

{"key2":[{"property":"differentProperty","name":"someOtherName","type":"someOtherType"}]}

Is there any way to obtain it straight away or I should rather parse the delta ?

If this may be achieved using formatters, then which one is the way to go ?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions