{"action":"created","comment":{"url":"https://api.github.com/repos/otiai10/cwl.go/pulls/comments/205667721","pull_request_review_id":140984814,"id":205667721,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNTY2NzcyMQ==","diff_hunk":"@@ -230,27 +230,37 @@ func (input *Input) Flatten() []string {\n \t\t}\n \t}\n \tflattened := []string{}\n-\tif repr := input.Types[0]; len(input.Types) == 1 {\n-\t\tswitch repr.Type {\n-\t\tcase \"array\":\n-\t\t\tflattened = append(flattened, input.flatten(repr.Items[0], repr.Binding, input.Provided.Raw)...)\n-\t\tcase \"int\":\n-\t\t\tflattened = append(flattened, fmt.Sprintf(\"%v\", input.Provided.Int))\n-\t\tcase \"File\":\n-\t\t\tflattened = append(flattened, input.Provided.Entry.Location)\n-\t\tcase \"Any\":\n-\t\t\tswitch v := input.Provided.Raw.(type) {\n-\t\t\tcase string:\n-\t\t\t\tflattened = append(flattened, v)\n-\t\t\tdefault:\n-\t\t\t\tflattened = append(flattened, fmt.Sprintf(\"%v\", v))\n+\tswitch input.Types[0].Type {\n+\tcase \"array\":\n+\t\tflattened = append(flattened, input.flatten(input.Types[0].Items[0], input.Types[0].Binding, input.Provided.Raw)...)\n+\t\tif len(flattened) == 0 {\n+\t\t\treturn flattened\n+\t\t}\n+\tcase \"int\":\n+\t\tflattened = append(flattened, fmt.Sprintf(\"%v\", input.Provided.Int))\n+\tcase \"File\":\n+\t\tflattened = append(flattened, input.Provided.Entry.Location)\n+\tcase \"Any\":\n+\t\tswitch v := input.Provided.Raw.(type) {\n+\t\tcase string:\n+\t\t\tflattened = append(flattened, v)\n+\t\tdefault:\n+\t\t\tflattened = append(flattened, fmt.Sprintf(\"%v\", v))\n+\t\t}\n+\tcase \"null\":\n+\t\tif len(input.Types) == 1 {","path":"input.go","position":46,"original_position":36,"commit_id":"6b71424a952a74e0f913b27f5f7d637d8e14ab7e","original_commit_id":"6b71424a952a74e0f913b27f5f7d637d8e14ab7e","user":{"login":"manabuishii","id":7508005,"node_id":"MDQ6VXNlcjc1MDgwMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/7508005?v=4","gravatar_id":"","url":"https://api.github.com/users/manabuishii","html_url":"https://github.com/manabuishii","followers_url":"https://api.github.com/users/manabuishii/followers","following_url":"https://api.github.com/users/manabuishii/following{/other_user}","gists_url":"https://api.github.com/users/manabuishii/gists{/gist_id}","starred_url":"https://api.github.com/users/manabuishii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manabuishii/subscriptions","organizations_url":"https://api.github.com/users/manabuishii/orgs","repos_url":"https://api.github.com/users/manabuishii/repos","events_url":"https://api.github.com/users/manabuishii/events{/privacy}","received_events_url":"https://api.github.com/users/manabuishii/received_events","type":"User","site_admin":false},"body":"上のコメント：\r\n配列の場合の意味については、仕様をみていますが、まだ該当箇所がわかっていないので、わかりしだいコメントします。\r\n\r\n下のコメント：\r\n`type` が `null` だけ（配列ではなく１つのみ）の場合のreturn については、以下を参照しました。\r\n[5.1.2 CommandLineBinding](https://www.commonwl.org/v1.0/CommandLineTool.html#CommandLineBinding) によると、 `null` の場合は、何もしなくてよいと解釈しました。\r\n\r\n```\r\nnull: Add nothing.\r\n```\r\n","created_at":"2018-07-27T04:53:11Z","updated_at":"2018-07-27T04:53:12Z","html_url":"https://github.com/otiai10/cwl.go/pull/35#discussion_r205667721","pull_request_url":"https://api.github.com/repos/otiai10/cwl.go/pulls/35","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/otiai10/cwl.go/pulls/comments/205667721"},"html":{"href":"https://github.com/otiai10/cwl.go/pull/35#discussion_r205667721"},"pull_request":{"href":"https://api.github.com/repos/otiai10/cwl.go/pulls/35"}},"in_reply_to_id":205659490},"pull_request":{"url":"https://api.github.com/repos/otiai10/cwl.go/pulls/35","id":203434426,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAzNDM0NDI2","html_url":"https://github.com/otiai10/cwl.go/pull/35","diff_url":"https://github.com/otiai10/cwl.go/pull/35.diff","patch_url":"https://github.com/otiai10/cwl.go/pull/35.patch","issue_url":"https://api.github.com/repos/otiai10/cwl.go/issues/35","number":35,"state":"open","locked":false,"title":"Support input array is empty","user":{"login":"manabuishii","id":7508005,"node_id":"MDQ6VXNlcjc1MDgwMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/7508005?v=4","gravatar_id":"","url":"https://api.github.com/users/manabuishii","html_url":"https://github.com/manabuishii","followers_url":"https://api.github.com/users/manabuishii/followers","following_url":"https://api.github.com/users/manabuishii/following{/other_user}","gists_url":"https://api.github.com/users/manabuishii/gists{/gist_id}","starred_url":"https://api.github.com/users/manabuishii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manabuishii/subscriptions","organizations_url":"https://api.github.com/users/manabuishii/orgs","repos_url":"https://api.github.com/users/manabuishii/repos","events_url":"https://api.github.com/users/manabuishii/events{/privacy}","received_events_url":"https://api.github.com/users/manabuishii/received_events","type":"User","site_admin":false},"body":"for conformance test 127\r\nempty-array-input.cwl, empty-array-job.json","created_at":"2018-07-24T07:31:53Z","updated_at":"2018-07-27T04:53:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f1e6e8ebe4b61c161b5864ba168c402690636df","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/otiai10/cwl.go/pulls/35/commits","review_comments_url":"https://api.github.com/repos/otiai10/cwl.go/pulls/35/comments","review_comment_url":"https://api.github.com/repos/otiai10/cwl.go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/otiai10/cwl.go/issues/35/comments","statuses_url":"https://api.github.com/repos/otiai10/cwl.go/statuses/6b71424a952a74e0f913b27f5f7d637d8e14ab7e","head":{"label":"manabuishii:conformance_test_n127","ref":"conformance_test_n127","sha":"6b71424a952a74e0f913b27f5f7d637d8e14ab7e","user":{"login":"manabuishii","id":7508005,"node_id":"MDQ6VXNlcjc1MDgwMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/7508005?v=4","gravatar_id":"","url":"https://api.github.com/users/manabuishii","html_url":"https://github.com/manabuishii","followers_url":"https://api.github.com/users/manabuishii/followers","following_url":"https://api.github.com/users/manabuishii/following{/other_user}","gists_url":"https://api.github.com/users/manabuishii/gists{/gist_id}","starred_url":"https://api.github.com/users/manabuishii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manabuishii/subscriptions","organizations_url":"https://api.github.com/users/manabuishii/orgs","repos_url":"https://api.github.com/users/manabuishii/repos","events_url":"https://api.github.com/users/manabuishii/events{/privacy}","received_events_url":"https://api.github.com/users/manabuishii/received_events","type":"User","site_admin":false},"repo":{"id":103151023,"node_id":"MDEwOlJlcG9zaXRvcnkxMDMxNTEwMjM=","name":"cwl.go","full_name":"manabuishii/cwl.go","owner":{"login":"manabuishii","id":7508005,"node_id":"MDQ6VXNlcjc1MDgwMDU=","avatar_url":"https://avatars1.githubusercontent.com/u/7508005?v=4","gravatar_id":"","url":"https://api.github.com/users/manabuishii","html_url":"https://github.com/manabuishii","followers_url":"https://api.github.com/users/manabuishii/followers","following_url":"https://api.github.com/users/manabuishii/following{/other_user}","gists_url":"https://api.github.com/users/manabuishii/gists{/gist_id}","starred_url":"https://api.github.com/users/manabuishii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/manabuishii/subscriptions","organizations_url":"https://api.github.com/users/manabuishii/orgs","repos_url":"https://api.github.com/users/manabuishii/repos","events_url":"https://api.github.com/users/manabuishii/events{/privacy}","received_events_url":"https://api.github.com/users/manabuishii/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/manabuishii/cwl.go","description":"CWL (and input file) parser for Golang, used by github.com/otiai10/yacle","fork":true,"url":"https://api.github.com/repos/manabuishii/cwl.go","forks_url":"https://api.github.com/repos/manabuishii/cwl.go/forks","keys_url":"https://api.github.com/repos/manabuishii/cwl.go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/manabuishii/cwl.go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/manabuishii/cwl.go/teams","hooks_url":"https://api.github.com/repos/manabuishii/cwl.go/hooks","issue_events_url":"https://api.github.com/repos/manabuishii/cwl.go/issues/events{/number}","events_url":"https://api.github.com/repos/manabuishii/cwl.go/events","assignees_url":"https://api.github.com/repos/manabuishii/cwl.go/assignees{/user}","branches_url":"https://api.github.com/repos/manabuishii/cwl.go/branches{/branch}","tags_url":"https://api.github.com/repos/manabuishii/cwl.go/tags","blobs_url":"https://api.github.com/repos/manabuishii/cwl.go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/manabuishii/cwl.go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/manabuishii/cwl.go/git/refs{/sha}","trees_url":"https://api.github.com/repos/manabuishii/cwl.go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/manabuishii/cwl.go/statuses/{sha}","languages_url":"https://api.github.com/repos/manabuishii/cwl.go/languages","stargazers_url":"https://api.github.com/repos/manabuishii/cwl.go/stargazers","contributors_url":"https://api.github.com/repos/manabuishii/cwl.go/contributors","subscribers_url":"https://api.github.com/repos/manabuishii/cwl.go/subscribers","subscription_url":"https://api.github.com/repos/manabuishii/cwl.go/subscription","commits_url":"https://api.github.com/repos/manabuishii/cwl.go/commits{/sha}","git_commits_url":"https://api.github.com/repos/manabuishii/cwl.go/git/commits{/sha}","comments_url":"https://api.github.com/repos/manabuishii/cwl.go/comments{/number}","issue_comment_url":"https://api.github.com/repos/manabuishii/cwl.go/issues/comments{/number}","contents_url":"https://api.github.com/repos/manabuishii/cwl.go/contents/{+path}","compare_url":"https://api.github.com/repos/manabuishii/cwl.go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/manabuishii/cwl.go/merges","archive_url":"https://api.github.com/repos/manabuishii/cwl.go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/manabuishii/cwl.go/downloads","issues_url":"https://api.github.com/repos/manabuishii/cwl.go/issues{/number}","pulls_url":"https://api.github.com/repos/manabuishii/cwl.go/pulls{/number}","milestones_url":"https://api.github.com/repos/manabuishii/cwl.go/milestones{/number}","notifications_url":"https://api.github.com/repos/manabuishii/cwl.go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/manabuishii/cwl.go/labels{/name}","releases_url":"https://api.github.com/repos/manabuishii/cwl.go/releases{/id}","deployments_url":"https://api.github.com/repos/manabuishii/cwl.go/deployments","created_at":"2017-09-11T15:08:56Z","updated_at":"2017-09-11T15:08:58Z","pushed_at":"2018-07-27T03:19:16Z","git_url":"git://github.com/manabuishii/cwl.go.git","ssh_url":"git@github.com:manabuishii/cwl.go.git","clone_url":"https://github.com/manabuishii/cwl.go.git","svn_url":"https://github.com/manabuishii/cwl.go","homepage":null,"size":258,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"otiai10:master","ref":"master","sha":"1e1ae72b470431b363d9b311c34c83febb4b6522","user":{"login":"otiai10","id":931554,"node_id":"MDQ6VXNlcjkzMTU1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/931554?v=4","gravatar_id":"","url":"https://api.github.com/users/otiai10","html_url":"https://github.com/otiai10","followers_url":"https://api.github.com/users/otiai10/followers","following_url":"https://api.github.com/users/otiai10/following{/other_user}","gists_url":"https://api.github.com/users/otiai10/gists{/gist_id}","starred_url":"https://api.github.com/users/otiai10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otiai10/subscriptions","organizations_url":"https://api.github.com/users/otiai10/orgs","repos_url":"https://api.github.com/users/otiai10/repos","events_url":"https://api.github.com/users/otiai10/events{/privacy}","received_events_url":"https://api.github.com/users/otiai10/received_events","type":"User","site_admin":false},"repo":{"id":97940708,"node_id":"MDEwOlJlcG9zaXRvcnk5Nzk0MDcwOA==","name":"cwl.go","full_name":"otiai10/cwl.go","owner":{"login":"otiai10","id":931554,"node_id":"MDQ6VXNlcjkzMTU1NA==","avatar_url":"https://avatars2.githubusercontent.com/u/931554?v=4","gravatar_id":"","url":"https://api.github.com/users/otiai10","html_url":"https://github.com/otiai10","followers_url":"https://api.github.com/users/otiai10/followers","following_url":"https://api.github.com/users/otiai10/following{/other_user}","gists_url":"https://api.github.com/users/otiai10/gists{/gist_id}","starred_url":"https://api.github.com/users/otiai10/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/otiai10/subscriptions","organizations_url":"https://api.github.com/users/otiai10/orgs","repos_url":"https://api.github.com/users/otiai10/repos","events_url":"https://api.github.com/users/otiai10/events{/privacy}","received_events_url":"https://api.github.com/users/otiai10/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/otiai10/cwl.go","description":"CWL (and input file) parser for Golang, used by github.com/otiai10/yacle","fork":false,"url":"https://api.github.com/repos/otiai10/cwl.go","forks_url":"https://api.github.com/repos/otiai10/cwl.go/forks","keys_url":"https://api.github.com/repos/otiai10/cwl.go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/otiai10/cwl.go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/otiai10/cwl.go/teams","hooks_url":"https://api.github.com/repos/otiai10/cwl.go/hooks","issue_events_url":"https://api.github.com/repos/otiai10/cwl.go/issues/events{/number}","events_url":"https://api.github.com/repos/otiai10/cwl.go/events","assignees_url":"https://api.github.com/repos/otiai10/cwl.go/assignees{/user}","branches_url":"https://api.github.com/repos/otiai10/cwl.go/branches{/branch}","tags_url":"https://api.github.com/repos/otiai10/cwl.go/tags","blobs_url":"https://api.github.com/repos/otiai10/cwl.go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/otiai10/cwl.go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/otiai10/cwl.go/git/refs{/sha}","trees_url":"https://api.github.com/repos/otiai10/cwl.go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/otiai10/cwl.go/statuses/{sha}","languages_url":"https://api.github.com/repos/otiai10/cwl.go/languages","stargazers_url":"https://api.github.com/repos/otiai10/cwl.go/stargazers","contributors_url":"https://api.github.com/repos/otiai10/cwl.go/contributors","subscribers_url":"https://api.github.com/repos/otiai10/cwl.go/subscribers","subscription_url":"https://api.github.com/repos/otiai10/cwl.go/subscription","commits_url":"https://api.github.com/repos/otiai10/cwl.go/commits{/sha}","git_commits_url":"https://api.github.com/repos/otiai10/cwl.go/git/commits{/sha}","comments_url":"https://api.github.com/repos/otiai10/cwl.go/comments{/number}","issue_comment_url":"https://api.github.com/repos/otiai10/cwl.go/issues/comments{/number}","contents_url":"https://api.github.com/repos/otiai10/cwl.go/contents/{+path}","compare_url":"https://api.github.com/repos/otiai10/cwl.go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/otiai10/cwl.go/merges","archive_url":"https://api.github.com/repos/otiai10/cwl.go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/otiai10/cwl.go/downloads","issues_url":"https://api.github.com/repos/otiai10/cwl.go/issues{/number}","pulls_url":"https://api.github.com/repos/otiai10/cwl.go/pulls{/number}","milestones_url":"https://api.github.com/repos/otiai10/cwl.go/milestones{/number}","notifications_url":"https://api.github.com/repos/otiai10/cwl.go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/otiai10/cwl.go/labels{/name}","releases_url":"https://api.github.com/repos/otiai10/cwl.go/releases{/id}","deployments_url":"https://api.github.com/repos/otiai10/cwl.go/deployments","created_at":"2017-07-21T11:27:35Z","updated_at":"2018-07-23T06:49:56Z","pushed_at":"2018-07-27T03:19:17Z","git_url":"git://github.com/otiai10/cwl.go.git","ssh_url":"git@github.com:otiai10/cwl.go.git","clone_url":"https://github.com/otiai10/cwl.go.git","svn_url":"https://github.com/otiai10/cwl.go","homepage":"https://godoc.org/github.com/otiai10/cwl.go","size":253,"stargazers_count":3,"watchers_count":3,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":2,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/otiai10/cwl.go/pulls/35"},"html":{"href":"https://github.com/otiai10/cwl.go/pull/35"},"issue":{"href":"https://api.github.com/repos/otiai10/cwl.go/issues/35"},"comments":{"href":"https://api.github.com/repos/otiai10/cwl.go/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/otiai10/cwl.go/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/otiai10/cwl.go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/otiai10/cwl.go/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/otiai10/cwl.go/statuses/6b71424a952a74e0f913b27f5f7d637d8e14ab7e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"manabuishii"}}