{"action":"created","comment":{"url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/comments/77024818","id":77024818,"diff_hunk":"@@ -63,7 +64,7 @@ object AttrSpec {\n   @JsonCreator\n   def create(\n               @JsonProperty(\"id\") id: String,\n-              @JsonProperty(\"type\") _dataType: String,\n+              @JsonProperty(\"type\") _dataType: Object,","path":"shared/src/main/scala/io/kaitai/struct/format/AttrSpec.scala","position":13,"original_position":13,"commit_id":"9fcd9311ded68d2725e559900b3c36722f6832cb","original_commit_id":"9fcd9311ded68d2725e559900b3c36722f6832cb","user":{"login":"codacy-bot","id":19940114,"avatar_url":"https://avatars.githubusercontent.com/u/19940114?v=3","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Field name '_dataType' does not match the regular expression '^[a-z][A-Za-z0-9]*$'](https://www.codacy.com/app/greycat-na-kor/kaitai_struct_compiler/file/3682711143/issues/source?bid=3217973&fileBranchId=3661528#l67)","created_at":"2016-08-31T16:44:30Z","updated_at":"2016-08-31T16:44:30Z","html_url":"https://github.com/kaitai-io/kaitai_struct_compiler/pull/16#discussion_r77024818","pull_request_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/comments/77024818"},"html":{"href":"https://github.com/kaitai-io/kaitai_struct_compiler/pull/16#discussion_r77024818"},"pull_request":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16","id":83488244,"html_url":"https://github.com/kaitai-io/kaitai_struct_compiler/pull/16","diff_url":"https://github.com/kaitai-io/kaitai_struct_compiler/pull/16.diff","patch_url":"https://github.com/kaitai-io/kaitai_struct_compiler/pull/16.patch","issue_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/16","number":16,"state":"open","locked":false,"title":"Switch","user":{"login":"GreyCat","id":157154,"avatar_url":"https://avatars.githubusercontent.com/u/157154?v=3","gravatar_id":"","url":"https://api.github.com/users/GreyCat","html_url":"https://github.com/GreyCat","followers_url":"https://api.github.com/users/GreyCat/followers","following_url":"https://api.github.com/users/GreyCat/following{/other_user}","gists_url":"https://api.github.com/users/GreyCat/gists{/gist_id}","starred_url":"https://api.github.com/users/GreyCat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GreyCat/subscriptions","organizations_url":"https://api.github.com/users/GreyCat/orgs","repos_url":"https://api.github.com/users/GreyCat/repos","events_url":"https://api.github.com/users/GreyCat/events{/privacy}","received_events_url":"https://api.github.com/users/GreyCat/received_events","type":"User","site_admin":false},"body":"Implemented very basic type switching: format parsing + language support for Ruby, Java, C# and Python.\r\n\r\nThe syntax is:\r\n\r\n```yaml\r\n  - id: code\r\n    type: u1\r\n  - id: body\r\n    type:\r\n      switch-on: code\r\n      cases:\r\n        73: intval\r\n        83: strval\r\n```\r\n\r\nor, with enums (implies that `code_enum` is defined):\r\n\r\n```yaml\r\n  - id: code\r\n    type: u1\r\n    enum: code_enum\r\n  - id: body\r\n    type:\r\n      switch-on: code\r\n      cases:\r\n        code_enum::intval: intval\r\n        code_enum::strval: strval\r\n```\r\n\r\nNo `else` case support so far, support for anything else besides user types is not tested (should work for duck-typed languages, would fail for C# and Java).\r\n\r\nThere are 2 new tests: `switch_manual_int` and `switch_manual_enum` already committed to tests repo. C#, Java and Ruby implementations work (although C# again has name clashes of enums vs attributes). Python implementation probably works too, but right now it's held back by class addressing issues.","created_at":"2016-08-31T16:42:33Z","updated_at":"2016-08-31T16:44:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a03ba3c525f2b82f7e0d434024cfb1ddd73cc9b0","assignee":{"login":"GreyCat","id":157154,"avatar_url":"https://avatars.githubusercontent.com/u/157154?v=3","gravatar_id":"","url":"https://api.github.com/users/GreyCat","html_url":"https://github.com/GreyCat","followers_url":"https://api.github.com/users/GreyCat/followers","following_url":"https://api.github.com/users/GreyCat/following{/other_user}","gists_url":"https://api.github.com/users/GreyCat/gists{/gist_id}","starred_url":"https://api.github.com/users/GreyCat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GreyCat/subscriptions","organizations_url":"https://api.github.com/users/GreyCat/orgs","repos_url":"https://api.github.com/users/GreyCat/repos","events_url":"https://api.github.com/users/GreyCat/events{/privacy}","received_events_url":"https://api.github.com/users/GreyCat/received_events","type":"User","site_admin":false},"assignees":[{"login":"GreyCat","id":157154,"avatar_url":"https://avatars.githubusercontent.com/u/157154?v=3","gravatar_id":"","url":"https://api.github.com/users/GreyCat","html_url":"https://github.com/GreyCat","followers_url":"https://api.github.com/users/GreyCat/followers","following_url":"https://api.github.com/users/GreyCat/following{/other_user}","gists_url":"https://api.github.com/users/GreyCat/gists{/gist_id}","starred_url":"https://api.github.com/users/GreyCat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GreyCat/subscriptions","organizations_url":"https://api.github.com/users/GreyCat/orgs","repos_url":"https://api.github.com/users/GreyCat/repos","events_url":"https://api.github.com/users/GreyCat/events{/privacy}","received_events_url":"https://api.github.com/users/GreyCat/received_events","type":"User","site_admin":false},{"login":"LogicAndTrick","id":3071180,"avatar_url":"https://avatars.githubusercontent.com/u/3071180?v=3","gravatar_id":"","url":"https://api.github.com/users/LogicAndTrick","html_url":"https://github.com/LogicAndTrick","followers_url":"https://api.github.com/users/LogicAndTrick/followers","following_url":"https://api.github.com/users/LogicAndTrick/following{/other_user}","gists_url":"https://api.github.com/users/LogicAndTrick/gists{/gist_id}","starred_url":"https://api.github.com/users/LogicAndTrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LogicAndTrick/subscriptions","organizations_url":"https://api.github.com/users/LogicAndTrick/orgs","repos_url":"https://api.github.com/users/LogicAndTrick/repos","events_url":"https://api.github.com/users/LogicAndTrick/events{/privacy}","received_events_url":"https://api.github.com/users/LogicAndTrick/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16/commits","review_comments_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16/comments","review_comment_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/16/comments","statuses_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/statuses/9fcd9311ded68d2725e559900b3c36722f6832cb","head":{"label":"kaitai-io:switch","ref":"switch","sha":"9fcd9311ded68d2725e559900b3c36722f6832cb","user":{"login":"kaitai-io","id":17322584,"avatar_url":"https://avatars.githubusercontent.com/u/17322584?v=3","gravatar_id":"","url":"https://api.github.com/users/kaitai-io","html_url":"https://github.com/kaitai-io","followers_url":"https://api.github.com/users/kaitai-io/followers","following_url":"https://api.github.com/users/kaitai-io/following{/other_user}","gists_url":"https://api.github.com/users/kaitai-io/gists{/gist_id}","starred_url":"https://api.github.com/users/kaitai-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaitai-io/subscriptions","organizations_url":"https://api.github.com/users/kaitai-io/orgs","repos_url":"https://api.github.com/users/kaitai-io/repos","events_url":"https://api.github.com/users/kaitai-io/events{/privacy}","received_events_url":"https://api.github.com/users/kaitai-io/received_events","type":"Organization","site_admin":false},"repo":{"id":52196052,"name":"kaitai_struct_compiler","full_name":"kaitai-io/kaitai_struct_compiler","owner":{"login":"kaitai-io","id":17322584,"avatar_url":"https://avatars.githubusercontent.com/u/17322584?v=3","gravatar_id":"","url":"https://api.github.com/users/kaitai-io","html_url":"https://github.com/kaitai-io","followers_url":"https://api.github.com/users/kaitai-io/followers","following_url":"https://api.github.com/users/kaitai-io/following{/other_user}","gists_url":"https://api.github.com/users/kaitai-io/gists{/gist_id}","starred_url":"https://api.github.com/users/kaitai-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaitai-io/subscriptions","organizations_url":"https://api.github.com/users/kaitai-io/orgs","repos_url":"https://api.github.com/users/kaitai-io/repos","events_url":"https://api.github.com/users/kaitai-io/events{/privacy}","received_events_url":"https://api.github.com/users/kaitai-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaitai-io/kaitai_struct_compiler","description":"Kaitai Struct: compiler to translate .ksy => .cpp / .cs / .java / .js / .py / .rb","fork":false,"url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler","forks_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/forks","keys_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/teams","hooks_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/hooks","issue_events_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/events{/number}","events_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/events","assignees_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/assignees{/user}","branches_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/branches{/branch}","tags_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/tags","blobs_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/statuses/{sha}","languages_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/languages","stargazers_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/stargazers","contributors_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/contributors","subscribers_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/subscribers","subscription_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/subscription","commits_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/contents/{+path}","compare_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/merges","archive_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/downloads","issues_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues{/number}","pulls_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls{/number}","milestones_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/milestones{/number}","notifications_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/labels{/name}","releases_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/releases{/id}","deployments_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/deployments","created_at":"2016-02-21T07:36:26Z","updated_at":"2016-08-28T22:33:36Z","pushed_at":"2016-08-31T16:42:33Z","git_url":"git://github.com/kaitai-io/kaitai_struct_compiler.git","ssh_url":"git@github.com:kaitai-io/kaitai_struct_compiler.git","clone_url":"https://github.com/kaitai-io/kaitai_struct_compiler.git","svn_url":"https://github.com/kaitai-io/kaitai_struct_compiler","homepage":"http://kaitai.io/","size":685,"stargazers_count":16,"watchers_count":16,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":16,"default_branch":"master"}},"base":{"label":"kaitai-io:master","ref":"master","sha":"1bd7ff0f81790a446de5138614bb3d3944a4d23f","user":{"login":"kaitai-io","id":17322584,"avatar_url":"https://avatars.githubusercontent.com/u/17322584?v=3","gravatar_id":"","url":"https://api.github.com/users/kaitai-io","html_url":"https://github.com/kaitai-io","followers_url":"https://api.github.com/users/kaitai-io/followers","following_url":"https://api.github.com/users/kaitai-io/following{/other_user}","gists_url":"https://api.github.com/users/kaitai-io/gists{/gist_id}","starred_url":"https://api.github.com/users/kaitai-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaitai-io/subscriptions","organizations_url":"https://api.github.com/users/kaitai-io/orgs","repos_url":"https://api.github.com/users/kaitai-io/repos","events_url":"https://api.github.com/users/kaitai-io/events{/privacy}","received_events_url":"https://api.github.com/users/kaitai-io/received_events","type":"Organization","site_admin":false},"repo":{"id":52196052,"name":"kaitai_struct_compiler","full_name":"kaitai-io/kaitai_struct_compiler","owner":{"login":"kaitai-io","id":17322584,"avatar_url":"https://avatars.githubusercontent.com/u/17322584?v=3","gravatar_id":"","url":"https://api.github.com/users/kaitai-io","html_url":"https://github.com/kaitai-io","followers_url":"https://api.github.com/users/kaitai-io/followers","following_url":"https://api.github.com/users/kaitai-io/following{/other_user}","gists_url":"https://api.github.com/users/kaitai-io/gists{/gist_id}","starred_url":"https://api.github.com/users/kaitai-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaitai-io/subscriptions","organizations_url":"https://api.github.com/users/kaitai-io/orgs","repos_url":"https://api.github.com/users/kaitai-io/repos","events_url":"https://api.github.com/users/kaitai-io/events{/privacy}","received_events_url":"https://api.github.com/users/kaitai-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaitai-io/kaitai_struct_compiler","description":"Kaitai Struct: compiler to translate .ksy => .cpp / .cs / .java / .js / .py / .rb","fork":false,"url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler","forks_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/forks","keys_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/teams","hooks_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/hooks","issue_events_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/events{/number}","events_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/events","assignees_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/assignees{/user}","branches_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/branches{/branch}","tags_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/tags","blobs_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/statuses/{sha}","languages_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/languages","stargazers_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/stargazers","contributors_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/contributors","subscribers_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/subscribers","subscription_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/subscription","commits_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/contents/{+path}","compare_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/merges","archive_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/downloads","issues_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues{/number}","pulls_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls{/number}","milestones_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/milestones{/number}","notifications_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/labels{/name}","releases_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/releases{/id}","deployments_url":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/deployments","created_at":"2016-02-21T07:36:26Z","updated_at":"2016-08-28T22:33:36Z","pushed_at":"2016-08-31T16:42:33Z","git_url":"git://github.com/kaitai-io/kaitai_struct_compiler.git","ssh_url":"git@github.com:kaitai-io/kaitai_struct_compiler.git","clone_url":"https://github.com/kaitai-io/kaitai_struct_compiler.git","svn_url":"https://github.com/kaitai-io/kaitai_struct_compiler","homepage":"http://kaitai.io/","size":685,"stargazers_count":16,"watchers_count":16,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16"},"html":{"href":"https://github.com/kaitai-io/kaitai_struct_compiler/pull/16"},"issue":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/16"},"comments":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/kaitai-io/kaitai_struct_compiler/statuses/9fcd9311ded68d2725e559900b3c36722f6832cb"}}}}
{"actor":{"display_login":"codacy-bot"}}