Open hafeefshaik opened 6 years ago
Replace the original object's
"roles": [
"Developer",
"Admin"
]
with
"roles": [
"Admin",
"Developer"
]
and you'll get the result you expect.
JSON has no notion of sets, which might be part of the confusion.
The rfc6902.createPatch()
does not currently (PRs welcome!) implement the "move" operation, which I should document in the README somewhere.
That said, I admit I would find it a little more intuitive if it produced operations like:
But since each operation has the same "cost", it simply runs with the first 4-operation sequence it found.
@chbrown Thanks for the suggestion.
@chbrown
which I should document in the README somewhere.
Can someone do a PR for that ASAP? Cause misleading and waste of time for developer who want "move" operation until discover this issue.
Actual object:
Later added Business Analyst and Delivery Manager roles. Modified Object:
Result of rfc6902.createPatch()
Please correct me if I am wrong, I am expecting two add operations for newly added roles, However I could see replacing new role and adding existing roles. Please guide me.