{"action":"created","comment":{"url":"https://api.github.com/repos/api-platform/core/pulls/comments/184046300","pull_request_review_id":115160402,"id":184046300,"diff_hunk":"@@ -145,4 +151,17 @@ private function getNotAcceptableHttpException(string $accept, array $mimeTypes\n             implode('\", \"', $mimeTypes)\n         ));\n     }\n+\n+    private function getRequestFormats(Request $request): array\n+    {\n+        return $this->isDocumentation($request)\n+            ? $this->documentationFormats\n+            : $this->formats\n+        ;\n+    }\n+\n+    private function isDocumentation(Request $request): bool","path":"src/EventListener/AddFormatListener.php","position":77,"original_position":77,"commit_id":"b0accf4b49f7dcdbfd1274a1bc51d715c188c809","original_commit_id":"b0accf4b49f7dcdbfd1274a1bc51d715c188c809","user":{"login":"dunglas","id":57224,"avatar_url":"https://avatars2.githubusercontent.com/u/57224?v=4","gravatar_id":"","url":"https://api.github.com/users/dunglas","html_url":"https://github.com/dunglas","followers_url":"https://api.github.com/users/dunglas/followers","following_url":"https://api.github.com/users/dunglas/following{/other_user}","gists_url":"https://api.github.com/users/dunglas/gists{/gist_id}","starred_url":"https://api.github.com/users/dunglas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dunglas/subscriptions","organizations_url":"https://api.github.com/users/dunglas/orgs","repos_url":"https://api.github.com/users/dunglas/repos","events_url":"https://api.github.com/users/dunglas/events{/privacy}","received_events_url":"https://api.github.com/users/dunglas/received_events","type":"User","site_admin":false},"body":"Can you remove this function? (It's in the hot path, and function calls are costly).","created_at":"2018-04-25T12:52:33Z","updated_at":"2018-04-25T12:56:37Z","html_url":"https://github.com/api-platform/core/pull/1891#discussion_r184046300","pull_request_url":"https://api.github.com/repos/api-platform/core/pulls/1891","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments/184046300"},"html":{"href":"https://github.com/api-platform/core/pull/1891#discussion_r184046300"},"pull_request":{"href":"https://api.github.com/repos/api-platform/core/pulls/1891"}}},"pull_request":{"url":"https://api.github.com/repos/api-platform/core/pulls/1891","id":184019769,"html_url":"https://github.com/api-platform/core/pull/1891","diff_url":"https://github.com/api-platform/core/pull/1891.diff","patch_url":"https://github.com/api-platform/core/pull/1891.patch","issue_url":"https://api.github.com/repos/api-platform/core/issues/1891","number":1891,"state":"open","locked":false,"title":"add a specific \"documentation_formats\" that may differ from the API \"…","user":{"login":"jdeniau","id":1398469,"avatar_url":"https://avatars1.githubusercontent.com/u/1398469?v=4","gravatar_id":"","url":"https://api.github.com/users/jdeniau","html_url":"https://github.com/jdeniau","followers_url":"https://api.github.com/users/jdeniau/followers","following_url":"https://api.github.com/users/jdeniau/following{/other_user}","gists_url":"https://api.github.com/users/jdeniau/gists{/gist_id}","starred_url":"https://api.github.com/users/jdeniau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdeniau/subscriptions","organizations_url":"https://api.github.com/users/jdeniau/orgs","repos_url":"https://api.github.com/users/jdeniau/repos","events_url":"https://api.github.com/users/jdeniau/events{/privacy}","received_events_url":"https://api.github.com/users/jdeniau/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | yes\r\n| New feature?  | yes\r\n| BC breaks?    | See descrption\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #1854 \r\n| License       | MIT\r\n| Doc PR        | https://github.com/api-platform/docs/pull/475\r\n\r\nThis PR allow to disable the \"json\" format from the api and only allow jsonld for example, without breaking the swagger documentation.\r\n\r\nAbout the deprecation though: I removed \"json\" and \"html\" from the formats, to keep only \"jsonld\", and moved \"json\" and \"html\" to the documentation formats only.\r\nTechnically, it's a compatibility break, but as often can be seen as a bugfix (at least for the `html` format). \r\n\r\nIf you like, I can add the `json` format back, but as I see it, api-platform default is really nicely coupled with json-jd, so I assumed that the `json` format it was for documentation only.","created_at":"2018-04-25T12:31:28Z","updated_at":"2018-04-25T12:56:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"da6bed615ad0f7e7dc0fdf4a36eb58007bd3cff4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/api-platform/core/pulls/1891/commits","review_comments_url":"https://api.github.com/repos/api-platform/core/pulls/1891/comments","review_comment_url":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/api-platform/core/issues/1891/comments","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/b0accf4b49f7dcdbfd1274a1bc51d715c188c809","head":{"label":"jdeniau:jd-feat-documentationFormats","ref":"jd-feat-documentationFormats","sha":"b0accf4b49f7dcdbfd1274a1bc51d715c188c809","user":{"login":"jdeniau","id":1398469,"avatar_url":"https://avatars1.githubusercontent.com/u/1398469?v=4","gravatar_id":"","url":"https://api.github.com/users/jdeniau","html_url":"https://github.com/jdeniau","followers_url":"https://api.github.com/users/jdeniau/followers","following_url":"https://api.github.com/users/jdeniau/following{/other_user}","gists_url":"https://api.github.com/users/jdeniau/gists{/gist_id}","starred_url":"https://api.github.com/users/jdeniau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdeniau/subscriptions","organizations_url":"https://api.github.com/users/jdeniau/orgs","repos_url":"https://api.github.com/users/jdeniau/repos","events_url":"https://api.github.com/users/jdeniau/events{/privacy}","received_events_url":"https://api.github.com/users/jdeniau/received_events","type":"User","site_admin":false},"repo":{"id":39258639,"name":"api-platform-core","full_name":"jdeniau/api-platform-core","owner":{"login":"jdeniau","id":1398469,"avatar_url":"https://avatars1.githubusercontent.com/u/1398469?v=4","gravatar_id":"","url":"https://api.github.com/users/jdeniau","html_url":"https://github.com/jdeniau","followers_url":"https://api.github.com/users/jdeniau/followers","following_url":"https://api.github.com/users/jdeniau/following{/other_user}","gists_url":"https://api.github.com/users/jdeniau/gists{/gist_id}","starred_url":"https://api.github.com/users/jdeniau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdeniau/subscriptions","organizations_url":"https://api.github.com/users/jdeniau/orgs","repos_url":"https://api.github.com/users/jdeniau/repos","events_url":"https://api.github.com/users/jdeniau/events{/privacy}","received_events_url":"https://api.github.com/users/jdeniau/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdeniau/api-platform-core","description":"The Hypermedia REST API component of API Platform: JSON-LD and Hydra support, works with Symfony too","fork":true,"url":"https://api.github.com/repos/jdeniau/api-platform-core","forks_url":"https://api.github.com/repos/jdeniau/api-platform-core/forks","keys_url":"https://api.github.com/repos/jdeniau/api-platform-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdeniau/api-platform-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdeniau/api-platform-core/teams","hooks_url":"https://api.github.com/repos/jdeniau/api-platform-core/hooks","issue_events_url":"https://api.github.com/repos/jdeniau/api-platform-core/issues/events{/number}","events_url":"https://api.github.com/repos/jdeniau/api-platform-core/events","assignees_url":"https://api.github.com/repos/jdeniau/api-platform-core/assignees{/user}","branches_url":"https://api.github.com/repos/jdeniau/api-platform-core/branches{/branch}","tags_url":"https://api.github.com/repos/jdeniau/api-platform-core/tags","blobs_url":"https://api.github.com/repos/jdeniau/api-platform-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdeniau/api-platform-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdeniau/api-platform-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdeniau/api-platform-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdeniau/api-platform-core/statuses/{sha}","languages_url":"https://api.github.com/repos/jdeniau/api-platform-core/languages","stargazers_url":"https://api.github.com/repos/jdeniau/api-platform-core/stargazers","contributors_url":"https://api.github.com/repos/jdeniau/api-platform-core/contributors","subscribers_url":"https://api.github.com/repos/jdeniau/api-platform-core/subscribers","subscription_url":"https://api.github.com/repos/jdeniau/api-platform-core/subscription","commits_url":"https://api.github.com/repos/jdeniau/api-platform-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdeniau/api-platform-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdeniau/api-platform-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdeniau/api-platform-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdeniau/api-platform-core/contents/{+path}","compare_url":"https://api.github.com/repos/jdeniau/api-platform-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdeniau/api-platform-core/merges","archive_url":"https://api.github.com/repos/jdeniau/api-platform-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdeniau/api-platform-core/downloads","issues_url":"https://api.github.com/repos/jdeniau/api-platform-core/issues{/number}","pulls_url":"https://api.github.com/repos/jdeniau/api-platform-core/pulls{/number}","milestones_url":"https://api.github.com/repos/jdeniau/api-platform-core/milestones{/number}","notifications_url":"https://api.github.com/repos/jdeniau/api-platform-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdeniau/api-platform-core/labels{/name}","releases_url":"https://api.github.com/repos/jdeniau/api-platform-core/releases{/id}","deployments_url":"https://api.github.com/repos/jdeniau/api-platform-core/deployments","created_at":"2015-07-17T14:38:22Z","updated_at":"2018-04-25T08:47:46Z","pushed_at":"2018-04-25T12:36:44Z","git_url":"git://github.com/jdeniau/api-platform-core.git","ssh_url":"git@github.com:jdeniau/api-platform-core.git","clone_url":"https://github.com/jdeniau/api-platform-core.git","svn_url":"https://github.com/jdeniau/api-platform-core","homepage":"https://api-platform.com","size":7791,"stargazers_count":0,"watchers_count":0,"language":"PHP","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"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"api-platform:master","ref":"master","sha":"69058016db04aa73f426344f058e8d24a9b0bd0b","user":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars3.githubusercontent.com/u/13420081?v=4","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"repo":{"id":29501260,"name":"core","full_name":"api-platform/core","owner":{"login":"api-platform","id":13420081,"avatar_url":"https://avatars3.githubusercontent.com/u/13420081?v=4","gravatar_id":"","url":"https://api.github.com/users/api-platform","html_url":"https://github.com/api-platform","followers_url":"https://api.github.com/users/api-platform/followers","following_url":"https://api.github.com/users/api-platform/following{/other_user}","gists_url":"https://api.github.com/users/api-platform/gists{/gist_id}","starred_url":"https://api.github.com/users/api-platform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/api-platform/subscriptions","organizations_url":"https://api.github.com/users/api-platform/orgs","repos_url":"https://api.github.com/users/api-platform/repos","events_url":"https://api.github.com/users/api-platform/events{/privacy}","received_events_url":"https://api.github.com/users/api-platform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/api-platform/core","description":"The server component of API Platform: hypermedia and GraphQL APIs in minutes","fork":false,"url":"https://api.github.com/repos/api-platform/core","forks_url":"https://api.github.com/repos/api-platform/core/forks","keys_url":"https://api.github.com/repos/api-platform/core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/api-platform/core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/api-platform/core/teams","hooks_url":"https://api.github.com/repos/api-platform/core/hooks","issue_events_url":"https://api.github.com/repos/api-platform/core/issues/events{/number}","events_url":"https://api.github.com/repos/api-platform/core/events","assignees_url":"https://api.github.com/repos/api-platform/core/assignees{/user}","branches_url":"https://api.github.com/repos/api-platform/core/branches{/branch}","tags_url":"https://api.github.com/repos/api-platform/core/tags","blobs_url":"https://api.github.com/repos/api-platform/core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/api-platform/core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/api-platform/core/git/refs{/sha}","trees_url":"https://api.github.com/repos/api-platform/core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/api-platform/core/statuses/{sha}","languages_url":"https://api.github.com/repos/api-platform/core/languages","stargazers_url":"https://api.github.com/repos/api-platform/core/stargazers","contributors_url":"https://api.github.com/repos/api-platform/core/contributors","subscribers_url":"https://api.github.com/repos/api-platform/core/subscribers","subscription_url":"https://api.github.com/repos/api-platform/core/subscription","commits_url":"https://api.github.com/repos/api-platform/core/commits{/sha}","git_commits_url":"https://api.github.com/repos/api-platform/core/git/commits{/sha}","comments_url":"https://api.github.com/repos/api-platform/core/comments{/number}","issue_comment_url":"https://api.github.com/repos/api-platform/core/issues/comments{/number}","contents_url":"https://api.github.com/repos/api-platform/core/contents/{+path}","compare_url":"https://api.github.com/repos/api-platform/core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/api-platform/core/merges","archive_url":"https://api.github.com/repos/api-platform/core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/api-platform/core/downloads","issues_url":"https://api.github.com/repos/api-platform/core/issues{/number}","pulls_url":"https://api.github.com/repos/api-platform/core/pulls{/number}","milestones_url":"https://api.github.com/repos/api-platform/core/milestones{/number}","notifications_url":"https://api.github.com/repos/api-platform/core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/api-platform/core/labels{/name}","releases_url":"https://api.github.com/repos/api-platform/core/releases{/id}","deployments_url":"https://api.github.com/repos/api-platform/core/deployments","created_at":"2015-01-19T23:05:56Z","updated_at":"2018-04-25T10:12:40Z","pushed_at":"2018-04-25T12:36:45Z","git_url":"git://github.com/api-platform/core.git","ssh_url":"git@github.com:api-platform/core.git","clone_url":"https://github.com/api-platform/core.git","svn_url":"https://github.com/api-platform/core","homepage":"https://api-platform.com","size":7933,"stargazers_count":679,"watchers_count":679,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":229,"mirror_url":null,"archived":false,"open_issues_count":178,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":229,"open_issues":178,"watchers":679,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/api-platform/core/pulls/1891"},"html":{"href":"https://github.com/api-platform/core/pull/1891"},"issue":{"href":"https://api.github.com/repos/api-platform/core/issues/1891"},"comments":{"href":"https://api.github.com/repos/api-platform/core/issues/1891/comments"},"review_comments":{"href":"https://api.github.com/repos/api-platform/core/pulls/1891/comments"},"review_comment":{"href":"https://api.github.com/repos/api-platform/core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/api-platform/core/pulls/1891/commits"},"statuses":{"href":"https://api.github.com/repos/api-platform/core/statuses/b0accf4b49f7dcdbfd1274a1bc51d715c188c809"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dunglas"}}