ITV/scala-pact

Metadata information missing in the generated pact files

Closed this issue · 4 comments

In the pact-foundation specification of pact version-2, we have metadata information for generated pact-files: https://github.com/pact-foundation/pact-specification/tree/version-2#example

I see that scala-pact doesn't generate this information. The pact schema version information is really helpful when working between different pact library implementations.

Are we planning on implementing this going further?

Yes indeed. So far we've managed to live without it because we only support Pact V2 and since we follow the spec, integration with non-scala-pact pact generating consumers (JS/Ruby/Swift) has been smooth sailing. However when we finally move up to v3 I think this will be essential (and quite straight-forward, leave it out was an oversight the first time around).

I'm curious to know what you mean by this statement though:
"The pact schema version information is really helpful when working between different pact library implementations."

How is it useful? What do you use it for?

I can see the pact spec version being useful of course, but what do you gain by knowing which client generated it?

In our use case, it is helpful to know the version of the generated pact-file as the matching-type rules and the wildcard support varies between different pact-versions.

It becomes useful for compatibility of the producer of the API (or the service that verifies). If the information is visible in the pact files, it helps them choose a suitable version of the verify library that supports the pact schema.

For the project ticket:
This work is in progress on this branch pact-metadata.

dantb commented

Update - rebased pact-metadata on master, working through test failures