Skip to content
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

"pactSpecificationVersion": "3.0.0" is not supported #917

Closed
KarinBerg opened this issue Jul 31, 2019 · 7 comments
Closed

"pactSpecificationVersion": "3.0.0" is not supported #917

KarinBerg opened this issue Jul 31, 2019 · 7 comments

Comments

@KarinBerg
Copy link

KarinBerg commented Jul 31, 2019

As far as I understand the Pact Json Schema there are three different possibilities to specify the Pact specification version in a Pact file.

"metadata": {
"pactSpecificationVersion": "3.0.0",
"pact-specification": {
"version": "3.0.0"
},
"pactSpecification": {
"version": "3.0.0"
}
}

Unfortunately Pact-jvm seems not to support the first one “pactSpecificationVersion” when loading a Pact in a provider test. It always says that it can not find a Pact file. But after changing only the Pact specification version format to the last option “pactSpecification” it can find the Pact.

We are using “pact-jvm-provider-spring_2.12”.

Is it possible also to support the “pactSpecificationVersion” Option when loading a Pact from a broker and using it inside a provider test?

@uglyog
Copy link
Member

uglyog commented Aug 12, 2019

"pactSpecification": {
    "version": "3.0.0"
}

is the correct format. What is generating the format with pactSpecificationVersion?

@mwohllebe
Copy link

Can you explain why

"pactSpecification": {
"version": "3.0.0"
}

is the correct format, but

"pactSpecificationVersion": "3.0.0" is not.

The JSON schema for pact seems to allow both. See: https://bitbucket.org/atlassian/pact-json-schema/src/master/schemas/v2/schema.json

The class au.com.dius.pact.model.PactReader from pact-jvm currently supports only two of the three variants from the schema (pactSpecification and pact-specification, but not pactSpecificationVersion).

@KarinBerg
Copy link
Author

We are using the Pact library "https://github.com/Mattersight/pact-net-messages" to implement the consumer part of a pact for messages in .NET core. This library is generating the "pactSpecificationVersion" variant. And as @mwohllebe mentioned there seems to be three possible valid variants to specify the pact version. :)

@uglyog
Copy link
Member

uglyog commented Aug 18, 2019

Oh, right. Bit of history here. When Ben Sayers from Atlassian put together the JSON schemas for the pact file, he discovered that there where 3 variants of the pact spec version. I though we had discussed this and resolved to support the format from the Ruby implementation. But maybe we just talked about it and it was not implemented. Maybe Ben wanted the schema files to work with all the implementations out there.

But Pact-Ruby (and Pact-JS, Pact-Go, Pact-.NET which use Pact-Ruby), Pact-JVM and Pact-Rust all use the same format. We should get "https://github.com/Mattersight/pact-net-messages" to do the same.

@uglyog
Copy link
Member

uglyog commented Aug 25, 2019

@bethesque comments?

@bethesque
Copy link
Member

Yup, Ron is spot on with the history. Please raise an issue to change the pact net messages library.

@KarinBerg
Copy link
Author

Alright, I will do that. Thanks for clarification. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants