-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to match a non-json format respond body? #81
Comments
CSV matching is not supported (except in Pact Ruby). You can only do exact string matching unfortunately. |
I think this is a valid concern, so re-opening |
This highlights a deeper issue, how can we provide an extension mechanism for formats that don't have a default implementation. Maybe shared libraries, or possibly an embedded scripting language so that support for other formats can be easily added. |
The ruby one allows you to configure a differ based on the content type, so you can write your own. That's why it has the CSV support. |
I assume that needs to be written in Ruby and made available to the underlying Ruby engine. That you can't write it in the language being used? I was thinking of something like an API that allows extensions to be added in a generic way. |
I looked into this when spiking protobufs. Golang has very good support for cross platform plugins, and I showed that I could integrate that into rust as a lib. But then I just thought about the complexitybthay might result it. A possibly better alternative is to have the plugin expose an well defined API interface and register with the system. This would have the upside of allowing anyone to write a plugin in any language and would require them contributing it back (the downside is they will be written in many languages 😂) |
Could you provide more details/examples on CSV support? |
I haven't touched it for years, but here are the docs https://www.rubydoc.info/gems/pact-csv/0.0.1 |
|
Is it possible to verify non-json format response body? If my provider is written in Java?
It would be very useful to have it added into pact testing! |
A prototype CSV plugin has been written. See https://github.com/pact-foundation/pact-plugins/tree/main/plugins/csv |
Hi,
I have a pact file like this:
When I verified it on the provider side,
the test failed:
Any solutions? Thank you!
The text was updated successfully, but these errors were encountered: