How To Compare JSON Documents In Java
Lets think about a task, where we want to know the difference between 2 or more JSON documents. We may want to do it to display the history of edits of the document to review, validate, and have a chance to roll back these changes. For example, if we have two documents describing the movie Titanic: { "name": "Titanic", "length": 195, "genres": ["romance"], "cast": { "Jack": "James Cameron" } } and { "name": "Titanic", "genres": ["romance", "drama"], "cast": { "Jack": "Leonardo DiCaprio", "Rose": "Kate Winslet" } } How can we find the difference between those two? ...