pact-jvm-core-matchers 4.0.3: JsonNull does not match the type of JsonNull

Created on 19 Nov 2019  路  4Comments  路  Source: pact-foundation/pact-jvm

I have two JsonNull instances that are reported as not having the same type:

mismatches={$.0.link=[BodyMismatch(expected=null, actual=null, mismatch=Expected null (JsonNull) to be the same type as null (JsonNull), path=$.0.link, diff=null)] ...}

The bug seems to be in MatcherExecutor::matchType. JsonNull is never handled there.

bug

Most helpful comment

Version 4.0.5 has been released with this change

All 4 comments

Did anyone get a chance to look into this bug? If not, I'll try to make a PR myself when I have the time.

@audunhalland I'm having this same problem, are you by chance nesting your null within a like()?
We've noticed this problem come up when we converted from something like
const matcher = { a: null, b: like(someMatcher) };
to
const matcher = like({ a: null, b: someMatcher });

For me the problem appeared after an attempted upgrade from pact-jvm 3.x to 4.x.

Version 4.0.5 has been released with this change

Was this page helpful?
0 / 5 - 0 ratings