Comments (5)
Hi Neil, that makes sense and I don't think I'd be keen in your position either. You make a good point that the released PACTNet will cause errors, so even if somebody was using this by mistake we would find out pretty quickly. If I ever find myself with some time I'll take a look at those version 2 matchers.
from pact-specification.
This doesn't seem to require a specification change, just an implementation detail which language implementers can do.
I also don't see how this would work with nested objects in the body, they will not be compared if the values are skipped.
from pact-specification.
@ceddlyburge The only reason this has not been done in Pact-Net is that I personally don't have the time. I have actually done most of the refactoring to support v2, it just needs matchers and a whole heap of matcher validation. Have you had a look at the version-2
branch?
As mentioned in the PR, the beauty of open source is that you can fork and use a custom version which satisfies your needs. Personally I think this is the best option at this time, unless of course your are keen to help with v2?
from pact-specification.
Hi Neil
I'm not trying to get on your back about this, so apologies if it looks that way. I completely understand the lack of time argument, and am in the same boat myself.
Implementing the version 2 matchers looks significantly hard to me (maybe I am missing something), and I already have something that suits my purposes. I am not planning to do this, but if I were, I think it would take me many months to finish, and as mentioned, I already have something that works.
A new PACT minor version is not a necessary thing, being as I will keep everything in house, but it would be useful. For example, if somebody in my company mistakenly installs the official PACT net, instead of the one we have made, it would be nice if it rejected the new format PACT, at which point we would realise and do something about it.
Ronald, the specification change is because a client / consumer can specify whether it wants to ignore values or not, please see the snippet below. I think the code does work with nested objects, but will need to check this.
"interactions": [
{
"description": "A GET request for the yield",
"provider_state": "The yield I'm asking for exists",
"request": {
"method": "get",
"path": "/api/v1/Yields/fGERdev001",
"headers": {
"Accept": "application/json"
}
},
"response": {
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"Enet50": 1.0,
"Number": 1,
"Enet75": 1.0,
"Quality": "1",
"ProjectID": 1,
"YieldType": "1",
"Description": "1"
}
},
"valueAgnosticBodyComparison": true
}
],
Cheers
Cedd
from pact-specification.
@ceddlyburge Nah not at all, completely understand where you are coming from.
The issue with merging it into the public repo, is that I now take on support (maintenance, bug fixes, backwards compatibility etc etc). So whilst your intention is for you to only use it, other people will also start using it. Given that it is a concept that will be superseded by v2, I don't want to take this on.
For the accidental upgrade scenario you mentioned, on the consumer side you will see a compile failure. On the provider side the Pact verification test will fail, as the values will not match. So yeah I don't actually think you will have an issue there (other than the failure not pointing at exactly what is wrong).
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
- Support for extending Pact with plugins HOT 15
- 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.