-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Avoid generating uncompilable response body in Spring's API template #2903
Conversation
CCing Java technical committee for review : @bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog |
29cadc5
to
bba06ef
Compare
Just pushed updated samples |
…ting uncompilable example code
bba06ef
to
f82de07
Compare
@wing328, as discussed, here's the PR porting swagger-api/swagger-codegen#8691 to openapi-generator |
cc @bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) |
Is there anything missing in the PR ? |
@smasset thanks for the PR and my apologies for taking so long to review this change. Let's go with this enhancement in the upcoming release. |
* master: [csharp-netcore] Propagate raw content to the ApiException error content. (#4381) Remove path relative to my home dir. (#4470) Avoid generating uncompilable response body in Spring's API template (#2903) cpp-qt5-client: remove host since it is not well handled (#4429) [Java] Refactor webClient generator to use URI templates to capture correct metrics (#4314) [Java]: Client resttemplate and webclient: array parameters of type integer in path badly generated (#4379) Dart generate keywords (#4449) [core] Fix system properties being immutable (#4447) [Kotlin][Client] minor improvements (#4419) [typescript-rxjs]: Add support for nullable (#4438) [asciidoc] fix names of parameters (#4440)
Great news. |
@smasset thanks for the PR, which has been included in the v4.2.2 release: https://twitter.com/oas_generator/status/1201432648544972800 |
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.master
,4.1.x
,5.0.x
. Default:master
.Description of the PR
If definitions start to get complicated, example response bodies can exceed Java compiler's limit for constant strings.
This PR addresses this issue by introducing and using two new lambdas to remove any unnecessary whitespace and (if still needed) to split the constant string into smaller compilable parts using a StringBuilder to merge them back again.
Fixes #2186