Since this is a broad, non-coding question not strictly related to java, here are some related links:
- The twitter open-source Diffy server, comparing primary, secondary and candidate endpoints: https://github.com/twitter/diffy
- a similar, simpler http proxy: https://github.com/xthexder/httptee
- Someone doing this using JMeter:
https://dzone.com/articles/the-easiest-way-to-compare-rest-api-responses-usin
- An Example using Postman post-response hooks to compare requests: https://documenter.getpostman.com/view/33232/difference-between-two-responses/2QsCkC
- The Postman approach but using newman, a postman CLI client: https://github.com/indeedeng-alpha/newman-reporter-diff
Anyone feel free to edit my answer to add more alternatives demonstrating API response comparison