Getting a diff of two JSON strings using Java code

后端 未结 4 1004
无人及你
无人及你 2020-12-15 21:55

Can anybody suggest some Java Library or Code to get a diff of two JSON Strings?

4条回答
  •  天命终不由人
    2020-12-15 22:28

    Personally, I would suggest de-serializing the JSON strings back into objects and comparing the objects.

    That way you don't have to worry about extra whitespace/formatting between the two JSON strings (two strings could be formatted wildly different and still represent equal objects).

提交回复
热议问题