{"action":"opened","number":639,"pull_request":{"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/639","id":36850669,"html_url":"https://github.com/nelmio/NelmioApiDocBundle/pull/639","diff_url":"https://github.com/nelmio/NelmioApiDocBundle/pull/639.diff","patch_url":"https://github.com/nelmio/NelmioApiDocBundle/pull/639.patch","issue_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/639","number":639,"state":"open","locked":false,"title":"Fixing using serializer groups along with other parsers","user":{"login":"cristiangsp","id":498952,"avatar_url":"https://avatars.githubusercontent.com/u/498952?v=3","gravatar_id":"","url":"https://api.github.com/users/cristiangsp","html_url":"https://github.com/cristiangsp","followers_url":"https://api.github.com/users/cristiangsp/followers","following_url":"https://api.github.com/users/cristiangsp/following{/other_user}","gists_url":"https://api.github.com/users/cristiangsp/gists{/gist_id}","starred_url":"https://api.github.com/users/cristiangsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristiangsp/subscriptions","organizations_url":"https://api.github.com/users/cristiangsp/orgs","repos_url":"https://api.github.com/users/cristiangsp/repos","events_url":"https://api.github.com/users/cristiangsp/events{/privacy}","received_events_url":"https://api.github.com/users/cristiangsp/received_events","type":"User","site_admin":false},"body":"#### Description of the problem:\r\nSome users (me included) have experienced problems **using JMS Serializer groups along with Validation annotations**. The problem was that the fields of the class specified as input or output were not filtered properly by the groups whenever the field had some Validation annotation attached to it.\r\n\r\nThe problem is originated by the fact that the parsers collect all the information available and after that, the results of each parser are added all together. So it doesn´t matter that the JMS Serializer groups skipped some of the fields of the input/output class, if the field was also visited by some other parser, it will be added to the final output result.\r\n\r\nThat also means that the groups were not working properly in combination with any other parser too, not only with Validation annotations.\r\n\r\n#### Proposed solution:\r\nThis pull request proposes **adding a new boolean field with key \"excluded\"** to the data outputted by a parser about a input/output class field. That will allow a parser to mark a specific field as excluded and that information then will be shared to decide if the field should appear in the auto-generated docs or not.\r\n\r\nThe **JmsMetadataParser** has been modified to now check if a field should be skipped and if it should be skipped instead of just continue it sets \"excluded\" to true. The **rest of the parsers**, as they don´t have methods to exclude fields, have been modified to always return \"excluded\" as false.\r\n\r\nThe **method.twig** now check for the \"excluded\" field before rendering a field.\r\n\r\n#### Tests modified\r\nI have modified all the test related to parsers to expect the \"excluded\" field to be in the output generated. For the specific case of testing the **JmsMetadataParser** the tests related with groups have received deeper changes to maintain the new logic of not just skipping the fields that are not in specific groups.\r\n\r\nAlso the **SimpleFormatterTest** have been modified to take into account the new \"excluded\" field.\r\n\r\nLooking forward to see your comments about it.\r\nThanks.","created_at":"2015-06-03T16:21:07Z","updated_at":"2015-06-03T16:21:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/639/commits","review_comments_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/639/comments","review_comment_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/639/comments","statuses_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/statuses/b98ebf11189b3a88d56129add1dd955f28c57a1f","head":{"label":"cristiangsp:master","ref":"master","sha":"b98ebf11189b3a88d56129add1dd955f28c57a1f","user":{"login":"cristiangsp","id":498952,"avatar_url":"https://avatars.githubusercontent.com/u/498952?v=3","gravatar_id":"","url":"https://api.github.com/users/cristiangsp","html_url":"https://github.com/cristiangsp","followers_url":"https://api.github.com/users/cristiangsp/followers","following_url":"https://api.github.com/users/cristiangsp/following{/other_user}","gists_url":"https://api.github.com/users/cristiangsp/gists{/gist_id}","starred_url":"https://api.github.com/users/cristiangsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristiangsp/subscriptions","organizations_url":"https://api.github.com/users/cristiangsp/orgs","repos_url":"https://api.github.com/users/cristiangsp/repos","events_url":"https://api.github.com/users/cristiangsp/events{/privacy}","received_events_url":"https://api.github.com/users/cristiangsp/received_events","type":"User","site_admin":false},"repo":{"id":36794983,"name":"NelmioApiDocBundle","full_name":"cristiangsp/NelmioApiDocBundle","owner":{"login":"cristiangsp","id":498952,"avatar_url":"https://avatars.githubusercontent.com/u/498952?v=3","gravatar_id":"","url":"https://api.github.com/users/cristiangsp","html_url":"https://github.com/cristiangsp","followers_url":"https://api.github.com/users/cristiangsp/followers","following_url":"https://api.github.com/users/cristiangsp/following{/other_user}","gists_url":"https://api.github.com/users/cristiangsp/gists{/gist_id}","starred_url":"https://api.github.com/users/cristiangsp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cristiangsp/subscriptions","organizations_url":"https://api.github.com/users/cristiangsp/orgs","repos_url":"https://api.github.com/users/cristiangsp/repos","events_url":"https://api.github.com/users/cristiangsp/events{/privacy}","received_events_url":"https://api.github.com/users/cristiangsp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cristiangsp/NelmioApiDocBundle","description":"Generates documentation for your REST API from annotations","fork":true,"url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle","forks_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/forks","keys_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/teams","hooks_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/hooks","issue_events_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/issues/events{/number}","events_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/events","assignees_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/assignees{/user}","branches_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/branches{/branch}","tags_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/tags","blobs_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/languages","stargazers_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/stargazers","contributors_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/contributors","subscribers_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/subscribers","subscription_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/subscription","commits_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/contents/{+path}","compare_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/merges","archive_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/downloads","issues_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/issues{/number}","pulls_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/labels{/name}","releases_url":"https://api.github.com/repos/cristiangsp/NelmioApiDocBundle/releases{/id}","created_at":"2015-06-03T09:51:49Z","updated_at":"2015-06-03T09:51:50Z","pushed_at":"2015-06-03T15:33:48Z","git_url":"git://github.com/cristiangsp/NelmioApiDocBundle.git","ssh_url":"git@github.com:cristiangsp/NelmioApiDocBundle.git","clone_url":"https://github.com/cristiangsp/NelmioApiDocBundle.git","svn_url":"https://github.com/cristiangsp/NelmioApiDocBundle","homepage":"","size":5052,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nelmio:master","ref":"master","sha":"5de5d530dd9c11cb22455f422f41fc9431fcab67","user":{"login":"nelmio","id":460596,"avatar_url":"https://avatars.githubusercontent.com/u/460596?v=3","gravatar_id":"","url":"https://api.github.com/users/nelmio","html_url":"https://github.com/nelmio","followers_url":"https://api.github.com/users/nelmio/followers","following_url":"https://api.github.com/users/nelmio/following{/other_user}","gists_url":"https://api.github.com/users/nelmio/gists{/gist_id}","starred_url":"https://api.github.com/users/nelmio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelmio/subscriptions","organizations_url":"https://api.github.com/users/nelmio/orgs","repos_url":"https://api.github.com/users/nelmio/repos","events_url":"https://api.github.com/users/nelmio/events{/privacy}","received_events_url":"https://api.github.com/users/nelmio/received_events","type":"Organization","site_admin":false},"repo":{"id":4006755,"name":"NelmioApiDocBundle","full_name":"nelmio/NelmioApiDocBundle","owner":{"login":"nelmio","id":460596,"avatar_url":"https://avatars.githubusercontent.com/u/460596?v=3","gravatar_id":"","url":"https://api.github.com/users/nelmio","html_url":"https://github.com/nelmio","followers_url":"https://api.github.com/users/nelmio/followers","following_url":"https://api.github.com/users/nelmio/following{/other_user}","gists_url":"https://api.github.com/users/nelmio/gists{/gist_id}","starred_url":"https://api.github.com/users/nelmio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nelmio/subscriptions","organizations_url":"https://api.github.com/users/nelmio/orgs","repos_url":"https://api.github.com/users/nelmio/repos","events_url":"https://api.github.com/users/nelmio/events{/privacy}","received_events_url":"https://api.github.com/users/nelmio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nelmio/NelmioApiDocBundle","description":"Generates documentation for your REST API from annotations","fork":false,"url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle","forks_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/forks","keys_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/teams","hooks_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/hooks","issue_events_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/events{/number}","events_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/events","assignees_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/assignees{/user}","branches_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/branches{/branch}","tags_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/tags","blobs_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/statuses/{sha}","languages_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/languages","stargazers_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/stargazers","contributors_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/contributors","subscribers_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/subscribers","subscription_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/subscription","commits_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/contents/{+path}","compare_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/merges","archive_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/downloads","issues_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues{/number}","pulls_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls{/number}","milestones_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/milestones{/number}","notifications_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/labels{/name}","releases_url":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/releases{/id}","created_at":"2012-04-12T16:28:15Z","updated_at":"2015-06-02T23:58:01Z","pushed_at":"2015-06-02T16:16:13Z","git_url":"git://github.com/nelmio/NelmioApiDocBundle.git","ssh_url":"git@github.com:nelmio/NelmioApiDocBundle.git","clone_url":"https://github.com/nelmio/NelmioApiDocBundle.git","svn_url":"https://github.com/nelmio/NelmioApiDocBundle","homepage":"","size":5052,"stargazers_count":792,"watchers_count":792,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":317,"mirror_url":null,"open_issues_count":110,"forks":317,"open_issues":110,"watchers":792,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/639"},"html":{"href":"https://github.com/nelmio/NelmioApiDocBundle/pull/639"},"issue":{"href":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/639"},"comments":{"href":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/issues/639/comments"},"review_comments":{"href":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/639/comments"},"review_comment":{"href":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/pulls/639/commits"},"statuses":{"href":"https://api.github.com/repos/nelmio/NelmioApiDocBundle/statuses/b98ebf11189b3a88d56129add1dd955f28c57a1f"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":437,"deletions":8,"changed_files":15}}