Open gspetrou opened 5 years ago
Looking into this issue more we found the quote handling being done in this lambda function. We inserted a break point and noticed that the string coming into the method already has its double quotes properly escaped
"{\"testname\":\"amy\"}"
We believe this is part of the issue as the line linked above is then escaping the quotations again.
So we think we have a solution, but the problem . is that there is no tests for the code, and when we try to create tests, it's never hitting the bad code. We don't know how to cause the code we want to test to actually run.
Is there anyone out there familiar enough with the code who can tell us what we need to do to actually generate the API/Controller code?
I too have run into this problem, and am unable to use the "example" section in my API definition as the generated code doesn't have the correct escaping on the strings.
I tried using both 4.0.2 and the latest 4.1.0 versions, remains present in newer versions.
Leads to ERRORs in my Maven build with "illegal character: '\'"
error still exists in 6.6.0.
error still exists in 6.6.0.
and still in 7.6.0
Bug Report Checklist
Description
We are using OpenAPI and openapi-generator-maven-plugin with Spring Boot. We're trying to create an example object in our response. When the API/Controller code given is generated, it contains the syntax error shown below.
openapi-generator version
4.0.0
OpenAPI declaration file content or url
Command line used for generation
A Maven Plugin was used:
Steps to reproduce
The following is the generated code in the Controller/API. Notice the escaped backslash rather than the expected escaped quotation output.
Related issues/PRs
None that we are aware of.
Suggest a fix
We will investigate further and come back to edit this issue.