-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring-cloud-contract-maven-plugin does not escape double quotes in json strings #1850
Comments
I am seeing similar issue. If i hardcode the graphql json request body string in yml contract file then generated test converts triple \ to single \ . but if i put that string in a separate request.json then generated test works fine on producer side. but then generated stub doesn't match on consumer side. Can following code be responsible for this? @marcingrzejszczak
|
It's possible @huberchrigu can you rewrite the sample to use Java? That way it will be easier for me to debug what's going on |
@marcingrzejszczak I did the same in Java: https://github.com/huberchrigu/spring-cloud-contract-issue/tree/master/java |
Describe the bug
I generate contracts over Spring REST docs and convert them to stubs with the maven plugin. In a response I have a JSON String with escaped double quote. The stub should look like this:
But the maven plugin generates the body value as
. This stub won't work because it will lead to deserialization errors.
Sample
Run
mvn install
in this repository: https://github.com/huberchrigu/spring-cloud-contract-issue.target/generated-snippets/stubs/test.json
will look ok. Buttarget/stubs/.../mappings/test.json
will not. Latter is packaged into the stubs artifact, therefore the build does not create valid stubs right now.The text was updated successfully, but these errors were encountered: