Uh oh!
There was an error while loading. Please reload this page.
Avoid generating uncompilable response body in Spring's API template - #2903
Conversation
smasset
commented
May 15, 2019
CCing Java technical committee for review : @bbdouglas@sreeshas@jfiala@lukoyanov@cbornet@jeff9finger@karismann@Zomzog |
smasset
commented
May 16, 2019
Just pushed updated samples |
…ting uncompilable example code
smasset
commented
May 17, 2019
@wing328, as discussed, here's the PR porting swagger-api/swagger-codegen#8691 to openapi-generator |
wing328
commented
Aug 8, 2019
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) |
smasset
commented
Aug 30, 2019
Is there anything missing in the PR ? |
wing328
commented
Nov 12, 2019
@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)
smasset
commented
Nov 19, 2019
Great news. |
wing328
commented
Dec 2, 2019
@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.shif 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