The following contract fails to convert (spring-cloud-contract:convert) in 1.1.3 but converts successfully in 1.0.3 - why is this?
Is this a bug in JsonToJsonPathConverter (or) is the problem in contract itself?
~~~
package com.blah.blah
import org.springframework.cloud.contract.spec.Contract
Contract.make {
request {
method "POST"
urlPath('/batch/persons')
body("""
[{
"fruitsILike": [
"apple"
]
},
{
"fruitsILike": [
]
},
{
"fruitsILike": [
"orange"
]
}]
""")
}
response {
status 201
headers {
contentType(applicationJsonUtf8())
}
body("""{
"id": "${value(regex(uuid()))}"
}"
""")
}
}
~~~
Here is the call stack:
~~~
[ERROR] Failed to execute goal org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.3.RELEASE:convert (default-cli) on project blah-contracts: Execution default-cli of goal org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.3.RELEASE:convert failed: Unable to make conversion of testAbc.groovy: Parsed JSON [[{"fruitsILike":["apple"]},{"fruitsILike":[]},{"fruitsILike":["orange"]}]] with the JSON path [$[].['fruitsILike'][]] is not empty! -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.3.RELEASE:convert (default-cli) on project blah-contracts: Execution default-cli of goal org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.3.RELEASE:convert failed: Unable to make conversion of testAbc.groovy
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:47)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.springframework.cloud:spring-cloud-contract-maven-plugin:1.1.3.RELEASE:convert failed: Unable to make conversion of testAbc.groovy
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 21 more
Caused by: org.springframework.cloud.contract.verifier.converter.ConversionContractVerifierException: Unable to make conversion of testAbc.groovy
at org.springframework.cloud.contract.verifier.converter.RecursiveFilesConverter$_processFiles_closure1$_closure2.doCall(RecursiveFilesConverter.groovy:105)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2025)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2054)
at org.springframework.cloud.contract.verifier.converter.RecursiveFilesConverter$_processFiles_closure1.doCall(RecursiveFilesConverter.groovy:67)
at org.springframework.cloud.contract.verifier.converter.RecursiveFilesConverter$_processFiles_closure1.call(RecursiveFilesConverter.groovy)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2025)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2078)
at org.springframework.cloud.contract.verifier.converter.RecursiveFilesConverter.processFiles(RecursiveFilesConverter.groovy:66)
at org.springframework.cloud.contract.maven.verifier.ConvertMojo.execute(ConvertMojo.java:166)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 22 more
Caused by: java.lang.IllegalStateException: Parsed JSON [[{"fruitsILike":["apple"]},{"fruitsILike":[]},{"fruitsILike":["orange"]}]] with the JSON path [$[].['fruitsILike'][]] is not empty!
at com.toomuchcoding.jsonassert.JsonAsserter.isEmpty(JsonAsserter.java:182)
at org.springframework.cloud.contract.verifier.util.DelegatingJsonVerifiable.isEmpty(DelegatingJsonVerifiable.java:194)
at org.springframework.cloud.contract.verifier.util.MethodBufferingJsonVerifiable$isEmpty$4.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter.list(JsonToJsonPathsConverter.groovy:361)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter$_convertWithKey_closure10.doCall(JsonToJsonPathsConverter.groovy:352)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.callClosureForMapEntry(DefaultGroovyMethods.java:5276)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:3521)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.collectEntries(DefaultGroovyMethods.java:3547)
at org.codehaus.groovy.runtime.dgm$77.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter.convertWithKey(JsonToJsonPathsConverter.groovy:348)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSite.invoke(PogoMetaMethodSite.java:169)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter.traverseRecursively(JsonToJsonPathsConverter.groovy:204)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:384)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:69)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter$_traverseRecursively_closure5.doCall(JsonToJsonPathsConverter.groovy:224)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2025)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2066)
at org.codehaus.groovy.runtime.dgm$162.invoke(Unknown Source)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter.traverseRecursively(JsonToJsonPathsConverter.groovy:222)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter.traverseRecursivelyForKey(JsonToJsonPathsConverter.groovy:369)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:182)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter.transformToJsonPathWithValues(JsonToJsonPathsConverter.groovy:178)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter.transformToJsonPathWithStubsSideValuesAndNoArraySizeCheck(JsonToJsonPathsConverter.groovy:165)
at org.springframework.cloud.contract.verifier.util.JsonToJsonPathsConverter$transformToJsonPathWithStubsSideValuesAndNoArraySizeCheck$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockRequestStubStrategy.appendBody(WireMockRequestStubStrategy.groovy:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:166)
at org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockRequestStubStrategy.buildClientRequestContent(WireMockRequestStubStrategy.groovy:73)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:71)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.springframework.cloud.contract.verifier.dsl.wiremock.WireMockStubStrategy.toWireMockClientStub(WireMockStubStrategy.groovy:61)
at org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter.convertASingleContract(DslToWireMockClientConverter.groovy:42)
at org.springframework.cloud.contract.verifier.wiremock.DslToWireMockClientConverter.convertContents(DslToWireMockClientConverter.groovy:51)
at org.springframework.cloud.contract.verifier.converter.RecursiveFilesConverter$_processFiles_closure1$_closure2$_closure3.doCall(RecursiveFilesConverter.groovy:91)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:294)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1022)
at groovy.lang.Closure.call(Closure.java:414)
at groovy.lang.Closure.call(Closure.java:430)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2040)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2025)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2054)
at org.springframework.cloud.contract.verifier.converter.RecursiveFilesConverter$_processFiles_closure1$_closure2.doCall(RecursiveFilesConverter.groovy:90)
... 43 more
~~~
Believe it or not but I think that this is a feature ;) I think it's related to this https://github.com/spring-cloud/spring-cloud-contract/issues/203
Take a look at the created JSON Path $[*].['fruitsILike'][*] . In sc-contract when we generate the json path and in the JSON there's an array we're not asserting the order, so we need to use this [*] spread operator. It means that we check whether all arrays contain the fruitsIlike elements for example. Now, in the JSON one of the arrays contains an empty element. So according to https://github.com/spring-cloud/spring-cloud-contract/issues/203 we should ensure that it's empty. But the JSON Path returns a value (due to spread operators).
That's why we've introduced the testMatchers and stubMatchers for the users to regain control over asserting collections in a more concrete way.
Does it make sense? Sorry for the inconvenience with backward compatibility :/
I am not sure if it matters, but in #203 the assertions are about response but in my case, the assertions/matchers are with the request body.
I checked only with an empty array (only one element in the input/request), the mapping is just the same irrespective of whether I use 1.0.3 or 1.1.3. It still does not use the "isEmpty()" assertion that you introduced in #211 - i.e. I still see the following in the mapping (after the convert). I don't see "isEmpty()" assertion.
~~
"bodyPatterns" : [ {
"equalToJson" : "[{\"fruitsILike\":[]}]",
"ignoreArrayOrder" : false,
"ignoreExtraElements" : false
} ]
~
So I am not sure if #211 really caused the issue here.
In any case, why should the "convert" fail if the contract itself is not bad - (with my limited understanding) I feel that this is a bug of not being able to generate a JsonPath test for a case when there needs to be an assertion done for both an empty array and an array containing at least one element.
Ah you're right that you're using it on the request side... My gut feeling is that it's related somehow though.
The convert method fails cause we do some assertions on the input JSON while converting the contract into stub.
Anyways I'll take another look at it
It's a bug in JsonAssert. I fixed it and the version is on its way to central (https://github.com/marcingrzejszczak/jsonassert/issues/17) . Bump jsonassert to 0.4.10 and try again.
We bumped up jsonassert to 0.4.10 and we no longer get the error. Thank you for this quick fix!
Do you know when 521f27b will be available in maven central?
The closest one will be the Dalston.SR4 release. Probably next week. Until then just change the property jsonassert.version to contain 0.4.10. That way you won't have to wait for the release