{"action":"created","issue":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3355","repository_url":"https://api.github.com/repos/swagger-api/swagger-codegen","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3355/labels{/name}","comments_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3355/comments","events_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3355/events","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3355","id":165183889,"number":3355,"title":"[JAVA] Bug generating top level enum definitions (doesn't compile)","user":{"login":"diega","id":79943,"avatar_url":"https://avatars.githubusercontent.com/u/79943?v=3","gravatar_id":"","url":"https://api.github.com/users/diega","html_url":"https://github.com/diega","followers_url":"https://api.github.com/users/diega/followers","following_url":"https://api.github.com/users/diega/following{/other_user}","gists_url":"https://api.github.com/users/diega/gists{/gist_id}","starred_url":"https://api.github.com/users/diega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diega/subscriptions","organizations_url":"https://api.github.com/users/diega/orgs","repos_url":"https://api.github.com/users/diega/repos","events_url":"https://api.github.com/users/diega/events{/privacy}","received_events_url":"https://api.github.com/users/diega/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Bug","name":"Bug","color":"e11d21"},{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/labels/Server:%20Java","name":"Server: Java","color":"f7c6c7"}],"state":"open","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.3.0","labels_url":"https://api.github.com/repos/swagger-api/swagger-codegen/milestones/11/labels","id":1794308,"number":11,"title":"v2.3.0","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":177,"closed_issues":1,"state":"open","created_at":"2016-05-29T08:58:06Z","updated_at":"2016-07-13T08:35:27Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2016-07-12T21:19:38Z","updated_at":"2016-07-13T08:37:01Z","closed_at":null,"body":"##### Description\r\nIf I create an enum definition for using it in many objects, I get this file generated with compiling errors.\r\n\r\n##### Swagger-codegen version\r\nI'm using `master`\r\n\r\n##### Swagger declaration file content or url\r\n```yaml\r\nswagger: '2.0'\r\n\r\ninfo:\r\n  version: \"1.0.0\"\r\n  title: Title was not specified\r\nhost: 'localhost:9090'\r\nbasePath: /base\r\nschemes:\r\n  - http\r\npaths:\r\n  /test:\r\n    get:\r\n      responses:\r\n        '200':\r\n          description: Success\r\n          schema:\r\n            $ref: '#/definitions/FooObject'\r\n      operationId: getFooObject\r\ndefinitions:\r\n  FooObject:\r\n    properties:\r\n      myEnum:\r\n        $ref: '#/definitions/BarEnum'\r\n  BarEnum:\r\n    type: string\r\n    enum:\r\n      - AENUM\r\n      - BENUM\r\n```\r\n\r\n##### Command line used for generation\r\n`java -jar swagger-codegen-cli.jar generate -i test.yml -l spring -o swagger-output/`\r\n\r\n#### Output\r\nI get this exact output\r\n```\r\npackage io.swagger.model;\r\n\r\nimport java.util.Objects;\r\nimport com.fasterxml.jackson.annotation.JsonValue;\r\n\r\npublic enum BarEnum {\r\n    {values&#x3D;[AENUM, BENUM], enumVars&#x3D;[{name&#x3D;AENUM, value&#x3D;&quot;AENUM&quot;}, {name&#x3D;BENUM, value&#x3D;&quot;BENUM&quot;}]},\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/comments/232292836","html_url":"https://github.com/swagger-api/swagger-codegen/issues/3355#issuecomment-232292836","issue_url":"https://api.github.com/repos/swagger-api/swagger-codegen/issues/3355","id":232292836,"user":{"login":"diega","id":79943,"avatar_url":"https://avatars.githubusercontent.com/u/79943?v=3","gravatar_id":"","url":"https://api.github.com/users/diega","html_url":"https://github.com/diega","followers_url":"https://api.github.com/users/diega/followers","following_url":"https://api.github.com/users/diega/following{/other_user}","gists_url":"https://api.github.com/users/diega/gists{/gist_id}","starred_url":"https://api.github.com/users/diega/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diega/subscriptions","organizations_url":"https://api.github.com/users/diega/orgs","repos_url":"https://api.github.com/users/diega/repos","events_url":"https://api.github.com/users/diega/events{/privacy}","received_events_url":"https://api.github.com/users/diega/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T08:37:01Z","updated_at":"2016-07-13T08:37:01Z","body":"@wing328 sure, is there some fix already applied to _client_ generation you think could be applied to the _server_ generation?"}}
{"actor":{"display_login":"diega"}}