Comments (15)
Just to tag on a note from the google group where we've just had the same discussion :-)
Another way to go might be a linter / validator for implementation developers to use to ensure they'e conforming to agreed standards. I would have thought this would be fairly straight forward to set up given that we must read and validate Pact files already? The catch might be having the ability to specify which Pact version to validate against and providing version specific errors...
Just a thought.
from pact-specification.
I'm writing some code that parses pact files, I can't see anywhere in the specification tests where provider state is defined. Should it be providerState or provider_state? And has this changed between pact specification versions?
from pact-specification.
The original Ruby version used provider_state
, but that was changed very early on because JSON in general uses camel case. But more to your point, there is no formal example or schema in the specification project for a Pact file.
from pact-specification.
If you would accept a JSON Schema file for Pact I'd be happy to contribute it. I'd just need some guidance on where it should live and how we can test it's correctness. Maybe each of the pact fragments in this specification project could be validated by the schema?
from pact-specification.
More than happy to accept a Schema file. You can create it in the root of the project for the appropriate branch, and we need to also create an example test pact file for it. The test cases are not full pact files, so we can't use those.
from pact-specification.
@davesmith00000 That is a good idea, it won't be hard to take the existing Pact reading code out of one of the implementations and create a verifier tool.
from pact-specification.
The Rust work you've done @uglyog seems like a good candidate :)
from pact-specification.
I've made a start on creating the JSON Schemas and have a close to complete schema for Pact v1.0.0. I put it in a seperate project as I wanted to write automated tests to verify the schema is correct, but if you want to move it somewhere else I don't mind.
https://bitbucket.org/atlassian/pact-json-schema/overview
https://www.npmjs.com/package/pact-json-schema
Who is the best person to work with to check my assumptions?
from pact-specification.
I created a list of assumptions/questions I have here:
https://bitbucket.org/atlassian/pact-json-schema/issues/4/get-pact-community-to-validate-v1-schema
from pact-specification.
I get an Error "Access Denied" page trying to get to that issue, but I can browse the source.
In any case @uglyog and @bethesque are probably the best people to review this.
from pact-specification.
Sorry @mefellows I screwed up the permissions. Should be fixed now.
from pact-specification.
@uglyog @bethesque feel free to throw inline comments here, which you should have permission to do after logging in:
from pact-specification.
In https://bitbucket.org/atlassian/pact-json-schema/src/529795b6fc02df10b7a24f4390aa9fb9476473e8/schemas/v1/schema.json?at=master&fileviewer=file-view-default there is no mention of providerState. Only the very earliest pacts (mostly in REA) used provider_state, so I think it should be providerState.
from pact-specification.
What about consumer name and provider name?
from pact-specification.
Just a semantic issue, I'd say "There is one schema for each Pact specification version", because we don't want to confuse it with the concept of "pact instance versions".
from pact-specification.
Related Issues (20)
- Events driven architecture like aws event bridge contract testing HOT 1
- Feature Request - eachLike(itemDescriptionWithMatchers, exampleArray?) HOT 4
- Definitive word on PACT and HATEOAS HOT 1
- V4 Pact Specification Metadata format changed HOT 3
- Guidance and documentation needed to differentiate between event messages and command messages? HOT 1
- Pending pacts and can-i-deploy HOT 5
- Option to check for no undeclared fields HOT 3
- Generated pact file body include json_class, contents information and doesn't have matchingRules section HOT 2
- V4: Tracking issue for support of synchronous messages HOT 6
- V4: add a boolean matcher
- Matchers don't work with SSE response format HOT 1
- Question: providerStates allowed in any contract? HOT 1
- Type of regular expressions used in pact HOT 2
- How to match xml elements with namespace ? HOT 3
- Serialisation of ProviderStateGenerator HOT 2
- Add number range matcher
- json schema for version 3 pact files HOT 2
- The V4 Specification Retrospectively Alters the V3 Specification for Matchers and Generators HOT 6
- Either matcher in Pact HOT 2
- Convert PACT file to OAS 3.0 file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pact-specification.