I am making a collection where after hitting each API, I need to validate the response (in JSON) against my expected JSON which I have extracted after manually hitting the API first. I already know that I can pass this expected JSON as any other data variable from the CSV but the challenge is:
- The expected JSON is very large, and I have to do this for multiple APIs in the collection across multiple iterations
- The csv becomes VERY HEAVY and hard to maintain for any changes I need to make as its very tough to recognize where the JSON ended (I hope you can imagine).
- I want to use the same expected JSON across multiple collections, so I cannot "reuse" the same JSON and I am forced to write it everywhere, making it a maintenance nightmare.
I am looking for a way by which I can store the expected JSON in an external text file and a mechanism to provide the name/path of the txt file in the data.csv so as to centralize the expected JSONs.