{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2491","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2491/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2491/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2491/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/2491","id":145672674,"number":2491,"title":"Enumeration not working for case sensitive values","user":{"login":"sbelan","id":17060114,"avatar_url":"https://avatars.githubusercontent.com/u/17060114?v=3","gravatar_id":"","url":"https://api.github.com/users/sbelan","html_url":"https://github.com/sbelan","followers_url":"https://api.github.com/users/sbelan/followers","following_url":"https://api.github.com/users/sbelan/following{/other_user}","gists_url":"https://api.github.com/users/sbelan/gists{/gist_id}","starred_url":"https://api.github.com/users/sbelan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbelan/subscriptions","organizations_url":"https://api.github.com/users/sbelan/orgs","repos_url":"https://api.github.com/users/sbelan/repos","events_url":"https://api.github.com/users/sbelan/events{/privacy}","received_events_url":"https://api.github.com/users/sbelan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Client:%20Java","name":"Client: Java","color":"fad8c7"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Feature:%20Enum","name":"Feature: Enum","color":"eeccff"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Issue:%20Bug","name":"Issue: Bug","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/11","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.2.1","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/11/labels","id":1794308,"number":11,"title":"v2.2.1","description":"","creator":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":113,"state":"open","created_at":"2016-05-29T08:58:06Z","updated_at":"2016-08-08T09:38:00Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-04-04T12:38:23Z","updated_at":"2016-08-08T15:45:21Z","closed_at":"2016-08-05T09:26:18Z","body":"Hi @wing328 , I am using swagger stable version 2.1.5 for java client code generator. In my case server expecting values as case sensitive whereas swagger not able to generate case sensitive values for enum. Please find below scenario details:\r\n\r\nBelow is the sample swagger specification for my newPet model which consist of enum as case sensitive:\r\n\r\n> newPet:\r\n>     type: object\r\n>     required:\r\n>       - name\r\n>     properties:\r\n>       id:\r\n>         type: integer\r\n>         format: int64\r\n>       name:\r\n>         type: string\r\n>       Status:\r\n>         type: string\r\n>         enum: [Success, Failure]\r\n>       tag:\r\n>         type: string\r\n\r\nWhile generating java client codegen using Swagger 2.1.5, below enum code getting generated in my model:\r\n\r\n`public enum StatusEnum {\r\n  @SerializedName(\"Success\")\r\n  SUCCESS(\"Success\"),\r\n\r\n  @SerializedName(\"Failure\")\r\n  FAILURE(\"Failure\");\r\n\r\n  private String value;\r\n\r\n  StatusEnum(String value) {\r\n    this.value = value;\r\n  }\r\n\r\n  @Override\r\n  public String toString() {\r\n    return value;\r\n  }\r\n}`\r\n\r\nThen I set enum value into the request as \r\n\r\n> StatusEnum.SUCCESS\r\n\r\nwhereas it is expecting as \r\n\r\n> StatusEnum.Success\r\n\r\nBecause of this server throwing exception as its expecting value as case sensitive.\r\nPlease let me know if you require any more input on this or any sample code.\r\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/238278962","html_url":"https://github.com/swagger-api/swagger-codegen/issues/2491#issuecomment-238278962","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/2491","id":238278962,"user":{"login":"wing328","id":934260,"avatar_url":"https://avatars.githubusercontent.com/u/934260?v=3","gravatar_id":"","url":"https://api.github.com/users/wing328","html_url":"https://github.com/wing328","followers_url":"https://api.github.com/users/wing328/followers","following_url":"https://api.github.com/users/wing328/following{/other_user}","gists_url":"https://api.github.com/users/wing328/gists{/gist_id}","starred_url":"https://api.github.com/users/wing328/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wing328/subscriptions","organizations_url":"https://api.github.com/users/wing328/orgs","repos_url":"https://api.github.com/users/wing328/repos","events_url":"https://api.github.com/users/wing328/events{/privacy}","received_events_url":"https://api.github.com/users/wing328/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T15:45:21Z","updated_at":"2016-08-08T15:45:21Z","body":"Please open a new issue about your suggestion to use the \"String\" template so that the community can also join the discussion."}}
{"actor":{"display_login":"wing328"}}