Support the empty string as an enumeration value#4450
Merged
wing328 merged 1 commit intoswagger-api:masterfrom Jan 6, 2017
Merged
Support the empty string as an enumeration value#4450wing328 merged 1 commit intoswagger-api:masterfrom
wing328 merged 1 commit intoswagger-api:masterfrom
Conversation
When a string enumeration has the empty string as one of its available values, the generated code for many languages is invalid because the empty string can not be used as an identifier. As with numbers and symbols, provide a mapping to an English name which can be used as a replacement. In this case, "empty" for the empty string/empty value. Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Contributor
|
@kevinoid thanks for the contribution to cover this additional edge case. The change looks good to me. |
Contributor
Author
|
@wing328 Great. Thanks for reviewing and merging it! |
davidgri
pushed a commit
to davidgri/swagger-codegen
that referenced
this pull request
May 11, 2017
When a string enumeration has the empty string as one of its available values, the generated code for many languages is invalid because the empty string can not be used as an identifier. As with numbers and symbols, provide a mapping to an English name which can be used as a replacement. In this case, "empty" for the empty string/empty value. Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
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.
When a string enumeration has the empty string as one of its available values, the generated code for many languages is invalid because the empty string can not be used as an identifier. As with numbers and symbols, provide a mapping to an English name which can be used as a replacement. In this case, "empty" for the empty string/empty value.
Reviewer Note: I have updated all of the languages that I could find and updated the samples by running
./bin/run-all-petstoreand everything looks good. However, I have been unable to get Travis CI to run on my repo due to `nexus.codehaus.org: Unknown host nexus.codehaus.org and I was unable to run the integration tests on my machine. So some additional sanity checking would be greatly appreciated.