spring-cloud-contract
spring-cloud-contract copied to clipboard
boolean values are omitted when generate a RequestResponsePact from a Contract
I am using the ToFileContractsTransformer in version 3.0.4 to generate a PACT file from a Contract for HTTP as described in the reference documentation : https://docs.spring.io/spring-cloud-contract/docs/3.0.0/reference/htmlsingle/#how-to-generate-pact-from-scc.
My Contract looks like this :
package com.test
import org.springframework.cloud.contract.spec.Contract
Contract.make {
description("""
Some description...
""")
request {
...
}
response {
body(
[[
number : 1,
string : "Some string",
bool : true
]]
)
}
}
The generate PACT file looks like this :
{
"provider": {
"name": "..."
},
"consumer": {
"name": "..."
},
"interactions": [
{
"description": "Some description",
"request": {
...
},
"response": {
"body" : "[{\"number\":1,\"string\":\"Some string\"}]",
}
}
],
"metadata": {
"pactSpecification": {
"version": "3.0.0"
},
"pact-jvm": {
"version": "4.0.10"
}
}
}
I have also tried by setting the response body as string and I get the same result.
Is there another way to declare boolean values in request or response body ?
Thanks in advance.
That should work, it looks like a bug
PactConverter has been removed in Spring Cloud Contract 4.0.0 so we're not planning on doing additional work for it. We're working with the Pact Foundation to move the support to the foundation.