-
I'm trying to assert that a response's body has a specific JSON structure: {
"success": true,
"payload": null,
"errors": {
"all": []
}
} However, the API I'm testing against minifies the JSON output, so it becomes: {"success": true,"payload": null,"errors": {"all": []}} Using the following Hurl body assertion fails, because the output isn't pretty-formatted:
It's not too bad when I have a small response, but some of these can get quite large, and placing everything on a single line makes them pretty-much impossible to read properly. Is there a way to make the assertion ignore the formatting difference? Or do I need to work around it by dropping the JSON body assertion and just using |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @micka190 Thanks for the feedback. Effectively, the current JSON body assertion is whitespace sensitive and we want to change this. In a future release:
Will do a "semantic" assertion (whitespace insentive), that we've to specify, while:
Will do an exact match assertion. There're similar issue and we want to address them #270 #272 |
Beta Was this translation helpful? Give feedback.
Hi @micka190
Thanks for the feedback. Effectively, the current JSON body assertion is whitespace sensitive and we want to change this. In a future release:
Will do a "semantic" assertion (whitespace insentive), that we've to specify, while:
Will do an exact match assertion.
There're similar issue and we want to address them #270 #272
Another possibility (still not implemented) is to add support for JSON schema #543