{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/40719198","id":40719198,"diff_hunk":"@@ -88,6 +101,29 @@ func (s *SwaggerSchema) ValidateBytes(data []byte) error {\n \tif kind == nil {\n \t\treturn fmt.Errorf(\"kind not set\")\n \t}\n+\tif kind.(string) == \"List\" {\n+\t\titems, err := unpackObject(obj.(map[string]interface{}))\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\t\tfor _, item := range items {\n+\t\t\tfields := item.(map[string]interface{})\n+\t\t\tgroupVersion := fields[\"apiVersion\"]\n+\t\t\tif groupVersion == nil {\n+\t\t\t\treturn fmt.Errorf(\"list item apiVersion not set\")\n+\t\t\t}\n+\t\t\tkind := fields[\"kind\"]\n+\t\t\tif kind == nil {\n+\t\t\t\treturn fmt.Errorf(\"list item kind not set\")\n+\t\t\t}\n+\t\t\tversion := apiutil.GetVersion(groupVersion.(string))\n+\t\t\tallErrs := s.ValidateObject(item, \"\", version+\".\"+kind.(string))\n+\t\t\tif len(allErrs) == 1 {\n+\t\t\t\treturn allErrs[0]\n+\t\t\t}\n+\t\t\treturn errors.NewAggregate(allErrs)\n+\t\t}\n+\t}\n \tversion := apiutil.GetVersion(groupVersion.(string))\n \tallErrs := s.ValidateObject(obj, \"\", version+\".\"+kind.(string))","path":"pkg/api/validation/schema.go","position":48,"original_position":48,"commit_id":"7ba35ceb7ab4a7a024e1787df8cde403f48a03c0","original_commit_id":"7ba35ceb7ab4a7a024e1787df8cde403f48a03c0","user":{"login":"deads2k","id":8225098,"avatar_url":"https://avatars.githubusercontent.com/u/8225098?v=3","gravatar_id":"","url":"https://api.github.com/users/deads2k","html_url":"https://github.com/deads2k","followers_url":"https://api.github.com/users/deads2k/followers","following_url":"https://api.github.com/users/deads2k/following{/other_user}","gists_url":"https://api.github.com/users/deads2k/gists{/gist_id}","starred_url":"https://api.github.com/users/deads2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deads2k/subscriptions","organizations_url":"https://api.github.com/users/deads2k/orgs","repos_url":"https://api.github.com/users/deads2k/repos","events_url":"https://api.github.com/users/deads2k/events{/privacy}","received_events_url":"https://api.github.com/users/deads2k/received_events","type":"User","site_admin":false},"body":"This would double validate `List`, right?","created_at":"2015-09-29T19:44:49Z","updated_at":"2015-09-29T19:44:49Z","html_url":"https://github.com/kubernetes/kubernetes/pull/14726#discussion_r40719198","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/40719198"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/14726#discussion_r40719198"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726","id":46265304,"html_url":"https://github.com/kubernetes/kubernetes/pull/14726","diff_url":"https://github.com/kubernetes/kubernetes/pull/14726.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/14726.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14726","number":14726,"state":"open","locked":false,"title":"Add validate support for list kind","user":{"login":"linzichang","id":11015666,"avatar_url":"https://avatars.githubusercontent.com/u/11015666?v=3","gravatar_id":"","url":"https://api.github.com/users/linzichang","html_url":"https://github.com/linzichang","followers_url":"https://api.github.com/users/linzichang/followers","following_url":"https://api.github.com/users/linzichang/following{/other_user}","gists_url":"https://api.github.com/users/linzichang/gists{/gist_id}","starred_url":"https://api.github.com/users/linzichang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzichang/subscriptions","organizations_url":"https://api.github.com/users/linzichang/orgs","repos_url":"https://api.github.com/users/linzichang/repos","events_url":"https://api.github.com/users/linzichang/events{/privacy}","received_events_url":"https://api.github.com/users/linzichang/received_events","type":"User","site_admin":false},"body":"fix #13812 \r\n@bgrant0607 ","created_at":"2015-09-29T11:28:04Z","updated_at":"2015-09-29T19:44:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f810ffd50e475a3163dc5c10ac29d1c5cfc68a5","assignee":{"login":"erictune","id":8105590,"avatar_url":"https://avatars.githubusercontent.com/u/8105590?v=3","gravatar_id":"","url":"https://api.github.com/users/erictune","html_url":"https://github.com/erictune","followers_url":"https://api.github.com/users/erictune/followers","following_url":"https://api.github.com/users/erictune/following{/other_user}","gists_url":"https://api.github.com/users/erictune/gists{/gist_id}","starred_url":"https://api.github.com/users/erictune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erictune/subscriptions","organizations_url":"https://api.github.com/users/erictune/orgs","repos_url":"https://api.github.com/users/erictune/repos","events_url":"https://api.github.com/users/erictune/events{/privacy}","received_events_url":"https://api.github.com/users/erictune/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14726/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/7ba35ceb7ab4a7a024e1787df8cde403f48a03c0","head":{"label":"linzichang:validation-on-list","ref":"validation-on-list","sha":"7ba35ceb7ab4a7a024e1787df8cde403f48a03c0","user":{"login":"linzichang","id":11015666,"avatar_url":"https://avatars.githubusercontent.com/u/11015666?v=3","gravatar_id":"","url":"https://api.github.com/users/linzichang","html_url":"https://github.com/linzichang","followers_url":"https://api.github.com/users/linzichang/followers","following_url":"https://api.github.com/users/linzichang/following{/other_user}","gists_url":"https://api.github.com/users/linzichang/gists{/gist_id}","starred_url":"https://api.github.com/users/linzichang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzichang/subscriptions","organizations_url":"https://api.github.com/users/linzichang/orgs","repos_url":"https://api.github.com/users/linzichang/repos","events_url":"https://api.github.com/users/linzichang/events{/privacy}","received_events_url":"https://api.github.com/users/linzichang/received_events","type":"User","site_admin":false},"repo":{"id":41089917,"name":"kubernetes","full_name":"linzichang/kubernetes","owner":{"login":"linzichang","id":11015666,"avatar_url":"https://avatars.githubusercontent.com/u/11015666?v=3","gravatar_id":"","url":"https://api.github.com/users/linzichang","html_url":"https://github.com/linzichang","followers_url":"https://api.github.com/users/linzichang/followers","following_url":"https://api.github.com/users/linzichang/following{/other_user}","gists_url":"https://api.github.com/users/linzichang/gists{/gist_id}","starred_url":"https://api.github.com/users/linzichang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzichang/subscriptions","organizations_url":"https://api.github.com/users/linzichang/orgs","repos_url":"https://api.github.com/users/linzichang/repos","events_url":"https://api.github.com/users/linzichang/events{/privacy}","received_events_url":"https://api.github.com/users/linzichang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/linzichang/kubernetes","description":"Container Cluster Manager from Google","fork":true,"url":"https://api.github.com/repos/linzichang/kubernetes","forks_url":"https://api.github.com/repos/linzichang/kubernetes/forks","keys_url":"https://api.github.com/repos/linzichang/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linzichang/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linzichang/kubernetes/teams","hooks_url":"https://api.github.com/repos/linzichang/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/linzichang/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/linzichang/kubernetes/events","assignees_url":"https://api.github.com/repos/linzichang/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/linzichang/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/linzichang/kubernetes/tags","blobs_url":"https://api.github.com/repos/linzichang/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linzichang/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linzichang/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/linzichang/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linzichang/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/linzichang/kubernetes/languages","stargazers_url":"https://api.github.com/repos/linzichang/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/linzichang/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/linzichang/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/linzichang/kubernetes/subscription","commits_url":"https://api.github.com/repos/linzichang/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/linzichang/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/linzichang/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/linzichang/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/linzichang/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/linzichang/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linzichang/kubernetes/merges","archive_url":"https://api.github.com/repos/linzichang/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linzichang/kubernetes/downloads","issues_url":"https://api.github.com/repos/linzichang/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/linzichang/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/linzichang/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/linzichang/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linzichang/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/linzichang/kubernetes/releases{/id}","created_at":"2015-08-20T10:24:24Z","updated_at":"2015-08-20T10:24:31Z","pushed_at":"2015-09-29T11:26:54Z","git_url":"git://github.com/linzichang/kubernetes.git","ssh_url":"git@github.com:linzichang/kubernetes.git","clone_url":"https://github.com/linzichang/kubernetes.git","svn_url":"https://github.com/linzichang/kubernetes","homepage":"http://kubernetes.io","size":111912,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"7b428d8bcdc6dffb5df391b5493a1775b98931a1","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-09-29T18:54:53Z","pushed_at":"2015-09-29T19:29:49Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":437790,"stargazers_count":10491,"watchers_count":10491,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2618,"mirror_url":null,"open_issues_count":1978,"forks":2618,"open_issues":1978,"watchers":10491,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/14726"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/14726"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/14726/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/14726/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/7ba35ceb7ab4a7a024e1787df8cde403f48a03c0"}}}}