How to validate an XML response using Pact

旧时模样 提交于 2019-12-13 16:30:32

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!