Is it possible to verify xml responses and carry x...
# general
s
Is it possible to verify xml responses and carry xml payload in http verification with pact. If yes, is it a direct verification like json dsl or there is some other way
m
Only some languages support XML, see https://docs.pact.io/roadmap/feature_support But it’s like JSON, yes
s
According to the feature support doc, XML support is there in pactgo, but you said its not there as answer to one of the question in stackoverflow. Could you clarify, please? And in pact js, the documentation says, you can build xml using xmlbuilder and then convert it to json only. Does it mean , we have to transform the xml response before verifying in producer as well as consumer
m
apologies, that looks to be a mistake - I’ve corrected it now
And in pact js, the documentation says, you can build xml using xmlbuilder and then convert it to json only.
If you’re referring to what’s stated https://github.com/pact-foundation/pact-js/blob/master/docs/xml.md, it’s probably just poorly worded. It’s XML.
Does it mean , we have to transform the xml response before verifying in producer as well as consumer
No, it would expect the XML content-type
thanks for drawing attention to the docs correction
In the SO answer, it’s true that under the hood it supports XML, so it’s just about exposing it in the DSL. If you’re interested in conttributing, please let me know and I can give you some pointers