{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3611","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3611/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3611/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3611/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3611","id":171933472,"number":3611,"title":"Possible swagger hub codegen issue with Enums: @JsonValue annotation is missing from toString()","user":{"login":"ralgor14","id":21099922,"avatar_url":"https://avatars.githubusercontent.com/u/21099922?v=3","gravatar_id":"","url":"https://api.github.com/users/ralgor14","html_url":"https://github.com/ralgor14","followers_url":"https://api.github.com/users/ralgor14/followers","following_url":"https://api.github.com/users/ralgor14/following{/other_user}","gists_url":"https://api.github.com/users/ralgor14/gists{/gist_id}","starred_url":"https://api.github.com/users/ralgor14/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralgor14/subscriptions","organizations_url":"https://api.github.com/users/ralgor14/orgs","repos_url":"https://api.github.com/users/ralgor14/repos","events_url":"https://api.github.com/users/ralgor14/events{/privacy}","received_events_url":"https://api.github.com/users/ralgor14/received_events","type":"User","site_admin":false},"labels":[{"id":417609785,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Feature:%20Enum","name":"Feature: Enum","color":"eeccff","default":false},{"id":64180581,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Issue:%20Bug","name":"Issue: Bug","color":"e11d21","default":false},{"id":207268290,"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Server:%20Java","name":"Server: Java","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/13","html_url":"https://github.com/swagger-api/swagger-codegen/milestones/v2.2.2","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/13/labels","id":1928763,"number":13,"title":"v2.2.2","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":278,"closed_issues":390,"state":"open","created_at":"2016-08-08T09:16:56Z","updated_at":"2016-11-08T07:48:29Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2016-08-18T15:42:51Z","updated_at":"2016-11-08T07:57:18Z","closed_at":"2016-08-22T03:02:01Z","body":"Description\n\nThe @JsonValue annotation is missing when codegen creates java code (Server->jaxrs) for Enums.\nThis annotation should be on toString() method.\nThe following:\n        \"state\": {\n          \"type\": \"string\",\n          \"enum\": [\n            \"active\",\n            \"inactive\"\n          ]\n        }\n\ncauses creation of the following Enum code:\n  public enum StateEnum {\n    ACTIVE(\"active\"),\n\n```\nINACTIVE(\"inactive\");\n\nprivate String value;\n\nStateEnum(String value) {\n  this.value = value;\n}\n\n@Override\n public String toString() {\n  return String.valueOf(value);\n}\n```\n\n  }\n\nWhich causes \"active\" and \"inactive\" in JSON files to be unrecognized.\nIn order to correct it the annotation @JsonValue should be added before toString():\n    @Override\n    @JsonValue\n    public String toString() {\n      return String.valueOf(value);\n    }\n\nIt was OK in previous versions of swagger hub.\nAnnotations are used by jackson's fasterXml package.\n"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/259069841","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3611#issuecomment-259069841","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3611","id":259069841,"user":{"login":"apissdks","id":11532743,"avatar_url":"https://avatars.githubusercontent.com/u/11532743?v=3","gravatar_id":"","url":"https://api.github.com/users/apissdks","html_url":"https://github.com/apissdks","followers_url":"https://api.github.com/users/apissdks/followers","following_url":"https://api.github.com/users/apissdks/following{/other_user}","gists_url":"https://api.github.com/users/apissdks/gists{/gist_id}","starred_url":"https://api.github.com/users/apissdks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apissdks/subscriptions","organizations_url":"https://api.github.com/users/apissdks/orgs","repos_url":"https://api.github.com/users/apissdks/repos","events_url":"https://api.github.com/users/apissdks/events{/privacy}","received_events_url":"https://api.github.com/users/apissdks/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T07:57:18Z","updated_at":"2016-11-08T07:57:18Z","body":"It has dependency with the 2.2.2-SNAPSHOT swagger-codegen which should contain this fix right?"}}
{"actor":{"display_login":"apissdks"}}