If we have a library that's used by a bunch of app...
# general
s
If we have a library that's used by a bunch of apps and abstracts away the actual API calls to the provider service, -- is it recommended that the library itself writes a consumer contract? Rather than the apps that use the library? It seems to me that the library should be writing its own consumer contract and using
record-release
but I haven't seen much guidance on that on the site
t
Usually you'd do it in the library, yes. Then each user of the library would publish the library contract along with its contract. There is a disadvantage to that strategy, which is that you don't know if the users of the library are actually using all of the interactions in the contract, or all of the response data
The alternative is for each service to write their own contract around the library calls. The disadvantage of that approach is that the services using the library need to know the details of the request / response
s
Interesting are there docs/examples of this on the pact site? I didn’t see any that I could find about libraries like this specifically
t
I don't think so