Skip to content

[Swift3] rename reserved enum values#4201

Merged
wing328 merged 1 commit intoswagger-api:masterfrom
gierschv:fix-enum-reserved
Nov 18, 2016
Merged

[Swift3] rename reserved enum values#4201
wing328 merged 1 commit intoswagger-api:masterfrom
gierschv:fix-enum-reserved

Conversation

@gierschv
Copy link
Copy Markdown
Contributor

@gierschv gierschv commented Nov 16, 2016

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

fix(swift3): rename reserved enum values

Example:

- case public = "public"
+ case _public = "public"

@gierschv gierschv changed the title fix(swift3): rename reserved enuml values fix(swift3): rename reserved enum values Nov 16, 2016
@jaz-ah
Copy link
Copy Markdown
Contributor

jaz-ah commented Nov 16, 2016

looks like for other reserved words we do:

public String escapeReservedWord(String name) {
    return "_" + name;  // add an underscore to the name                                                                                                                                           
}

Example:
- case public = "public"
+ case _public = "public"

Signed-off-by: Vincent Giersch <vincent@giersch.fr>
@gierschv
Copy link
Copy Markdown
Contributor Author

@jaz-ah ok, updated.

@jaz-ah
Copy link
Copy Markdown
Contributor

jaz-ah commented Nov 16, 2016

+1 @wing328

@wing328 wing328 merged commit 9e08b63 into swagger-api:master Nov 18, 2016
@wing328 wing328 added this to the v2.2.2 milestone Nov 18, 2016
@wing328 wing328 changed the title fix(swift3): rename reserved enum values [Swift3] rename reserved enum values Feb 20, 2017
@gierschv gierschv deleted the fix-enum-reserved branch April 9, 2017 21:04
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
Example:
- case public = "public"
+ case _public = "public"

Signed-off-by: Vincent Giersch <vincent@giersch.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants