{"action":"created","issue":{"url":"https://api.github.com/repos/api-platform/core/issues/1379","repository_url":"https://api.github.com/repos/api-platform/core","labels_url":"https://api.github.com/repos/api-platform/core/issues/1379/labels{/name}","comments_url":"https://api.github.com/repos/api-platform/core/issues/1379/comments","events_url":"https://api.github.com/repos/api-platform/core/issues/1379/events","html_url":"https://github.com/api-platform/core/pull/1379","id":258254701,"number":1379,"title":"[PropertyFilter] Fix whitelist comparison","user":{"login":"antograssiot","id":4977112,"avatar_url":"https://avatars2.githubusercontent.com/u/4977112?v=4","gravatar_id":"","url":"https://api.github.com/users/antograssiot","html_url":"https://github.com/antograssiot","followers_url":"https://api.github.com/users/antograssiot/followers","following_url":"https://api.github.com/users/antograssiot/following{/other_user}","gists_url":"https://api.github.com/users/antograssiot/gists{/gist_id}","starred_url":"https://api.github.com/users/antograssiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antograssiot/subscriptions","organizations_url":"https://api.github.com/users/antograssiot/orgs","repos_url":"https://api.github.com/users/antograssiot/repos","events_url":"https://api.github.com/users/antograssiot/events{/privacy}","received_events_url":"https://api.github.com/users/antograssiot/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-09-16T19:54:49Z","updated_at":"2017-10-04T21:05:53Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/api-platform/core/pulls/1379","html_url":"https://github.com/api-platform/core/pull/1379","diff_url":"https://github.com/api-platform/core/pull/1379.diff","patch_url":"https://github.com/api-platform/core/pull/1379.patch"},"body":"| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | yes\r\n| New feature?  | yes\r\n| BC breaks?    | yes\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | \r\n| License       | MIT\r\n| Doc PR        | to come\r\n\r\nI'm using the GroupFilter with whitelist since it got merged but never really tried/used the ProprertyFilter whitelist in an application and just relied on the tests I wrote initially. When trying to use it in a real application last week I noticed that the behavior was not the expected one.\r\n\r\nAn example to reproduce the issue is to whitelist a `foo` property. Then when requesting `/resource?properties[]=bar`, `foo`will be present in the serialized entity.\r\n\r\nAnother thing I've been trying to fix is the filter declaration and it might be considered as a BC break but given the actual implementation is unusable, I'm pretty sure that we would know if someone would have tried/implemented it already.\r\nThe thing is that the array containing properties has numeric and non-numeric keys  like:\r\n```php\r\n[\r\n    'foo',\r\n    'bar',\r\n    'group' => ['baz, 'fuz'],\r\n]\r\n```\r\n\r\nI'm no expert but I didn't found a way to generate an array of this kind in yml. The old given example was generating the following:\r\n```php\r\n[\r\n    'foo',\r\n    'bar',\r\n    ['group' => ['baz, 'fuz']],\r\n]\r\n```\r\n\r\nSo in order to ease the array intersection, I went to a whitelist definition of the following form\r\n```\r\n['foo', 'bar', 'group.baz', 'group.fuz']\r\n```\r\n\r\nEven if this is sort of a a BC break, the actual implementation has no chance to work, and using this format will be more inline with the other filter.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/api-platform/core/issues/comments/334289319","html_url":"https://github.com/api-platform/core/pull/1379#issuecomment-334289319","issue_url":"https://api.github.com/repos/api-platform/core/issues/1379","id":334289319,"user":{"login":"antograssiot","id":4977112,"avatar_url":"https://avatars2.githubusercontent.com/u/4977112?v=4","gravatar_id":"","url":"https://api.github.com/users/antograssiot","html_url":"https://github.com/antograssiot","followers_url":"https://api.github.com/users/antograssiot/followers","following_url":"https://api.github.com/users/antograssiot/following{/other_user}","gists_url":"https://api.github.com/users/antograssiot/gists{/gist_id}","starred_url":"https://api.github.com/users/antograssiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antograssiot/subscriptions","organizations_url":"https://api.github.com/users/antograssiot/orgs","repos_url":"https://api.github.com/users/antograssiot/repos","events_url":"https://api.github.com/users/antograssiot/events{/privacy}","received_events_url":"https://api.github.com/users/antograssiot/received_events","type":"User","site_admin":false},"created_at":"2017-10-04T21:05:53Z","updated_at":"2017-10-04T21:05:53Z","author_association":"CONTRIBUTOR","body":"Looks cleaner/simpler indeed. \r\nI'll give it a try soon"}}
{"actor":{"display_login":"antograssiot"}}