问题
I am using Pact framework to test the response from an API. The responses are in XML format.Shown below is a sample of the response in my pact file.
"response": {
"status": 200,
"headers": {
"Content-Type": "application/xml"
},
"body": "`<rows p1='525'><row><seq_region_id>1</seq_region_id></row></rows>`"
}
while this works, when the XML response is large, it is difficult to include all of it in the "body" JSON key. Does Pact framework support XML responses, like it does for JSON? I would appreciate it if you could suggest a more suitable way to validate XML responses using Pact
回答1:
Sadly, you're out of luck as this functionality is not currently available. We might concentrate on more data types in the future, but as of yet, we have more important priorities to focus on. Cheers.
来源:https://stackoverflow.com/questions/44308349/how-to-validate-an-xml-response-using-pact