IBM / gauge-api-steps

A Python module providing reusable Gauge steps for API testing
MIT License
7 stars 2 forks source link

Extend JSON comparison to highlight differences #43

Closed DanielKuehnPanda closed 2 months ago

DanielKuehnPanda commented 5 months ago

Currently an Assertion between the JSON in the response to a file in the repository will lead to a unsatisfying validation error if there is a difference.

It would great when the error is documented for the report, that there would be highlighting on the response JSON of the keys and values that are different.

* Assert jsonpath "$" = "!{file:json-resp/test.json}"

For JSON diff's there are a number of libaries to pick from. My expectation would be to get something like the following in the end: Java: https://github.com/deblockt/json-diff

mario-s commented 5 months ago

Should it generate a patch, like shown in the Readme of json-diff, that highlights expected and actual?

DanielKuehnPanda commented 5 months ago

the patch is good, but only if the color coding is included

image

derdualist commented 3 months ago

Color coding would be possible, but please in another issue.