Fixes in escaping when generating Java from swagger.json.#5234
Closed
spr3nk3ls wants to merge 6842 commits intoswagger-api:masterfrom
Closed
Fixes in escaping when generating Java from swagger.json.#5234spr3nk3ls wants to merge 6842 commits intoswagger-api:masterfrom
spr3nk3ls wants to merge 6842 commits intoswagger-api:masterfrom
Conversation
…-api#4712) * add language for resteasy eap swagger-api#4512 * first implementation of jaxrs-resteasy-eap swagger-api#4512 * add support for joda and java8 datetime types swagger-api#4512 * add new file JacksonConfig and new sample eap-joda swagger-api#4512 * add dynamic swagger support to jaxrs-resteasy-eap swagger-api#4512 * adapt readme for eap swagger-api#4512 * add tests for jaxrs-resteasy-eap swagger-api#4512 * cleanup tabs swagger-api#4512 * cleanup tabs swagger-api#4512 * cleanup tabs swagger-api#4512 * cleanup tabs / regenerate without joda swagger-api#4512 * regenerate with updated templates swagger-api#4512 * fix test (wrong setter invoked) swagger-api#4512 * fix test swagger-api#4512 * fix no invocation swagger-api#4512 * replace tabs with spaces swagger-api#4512
updated parser version
…-codegen into swagger-lib-versions
…ions updated core versions
…-timestamp Remove inflector timestamp
update to release versions
…cyfx samples (swagger-api#5209) * Add packageGuid parameter to NancyFxServerCodegen. * Use packageGuid parameter for nancyfx petstore samples.
…CoreServerCodegen. (swagger-api#5199) * Issue swagger-api#5196: add packageUid parameter to AspNetCoreServerCodeGen. * Change .bat file, too.
…pi#5210) * Fix MSF4J pom indentation. * Set MSF4J sample artifactId in the generator script. * Update MSF4J samples.
* Pretty-print swagger.json. (This was done via `jq`. In a later commit we'll generate it pretty-printed.) * Erlang Server: pretty-print generated swagger.json. * Update samples for Erlang-server.
…api#4820) This change enables top level enumeratons to be written out as: export type SortDirection = "Ascending" | "Descending"; vs. export class SortDirection { }
…ger-api#5231) * Issue swagger-api#3084: Support hideGenerationTimestamp for Undertow. * Issue swagger-api#3084: disable timestamp generation for undertow samples. * Update samples for Undertow.
Contributor
|
Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/swagger-api/swagger-codegen/graphs/contributors. Let me know if you need help fixing it. |
wing328
reviewed
Mar 28, 2017
| } | ||
|
|
||
| @Override | ||
| public Mustache.Compiler processCompiler(Mustache.Compiler compiler) { |
Contributor
There was a problem hiding this comment.
Instead of turning it off, what about using {{{ ... }}} instead to use the unescape value?
The change will have a lot of impacts to mustache templates used by Java AP clients as well as server stubs (spring. jaxrs, play, etc)
Contributor
Author
|
I was unable to fix this PR, so I made a new one with the suggested changes. See #5247 |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the PR
Some valid json expressions within a swagger.json file result in uncompilable Java code.
How to test:
Use this pom.xml and this swagger.json to generate an example swagger API client in Java.
Expected: the code generated results in compilable Java.
Result: the resulting Java does not compile, because expressions like '"example": "["RABO23124NL","RABO12345NL"]",' and '"example": "\"[A-Z.]{1,10}\",' are escaped incorrectly.