{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/4479","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/4479/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/4479/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/4479/events","html_url":"https://github.com/yiisoft/yii2/issues/4479","id":38849931,"number":4479,"title":"API:  Searching and filtering","user":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/feature:rest","name":"feature:rest","color":"bfd4f2"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:under%20discussion","name":"status:under discussion","color":"f7c6c7"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:feature","name":"type:feature","color":"02d7e1"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/6","html_url":"https://github.com/yiisoft/yii2/milestones/2.1.x","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/6/labels","id":458001,"number":6,"title":"2.1.x","description":"","creator":{"login":"qiangxue","id":993322,"avatar_url":"https://avatars.githubusercontent.com/u/993322?v=3","gravatar_id":"","url":"https://api.github.com/users/qiangxue","html_url":"https://github.com/qiangxue","followers_url":"https://api.github.com/users/qiangxue/followers","following_url":"https://api.github.com/users/qiangxue/following{/other_user}","gists_url":"https://api.github.com/users/qiangxue/gists{/gist_id}","starred_url":"https://api.github.com/users/qiangxue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiangxue/subscriptions","organizations_url":"https://api.github.com/users/qiangxue/orgs","repos_url":"https://api.github.com/users/qiangxue/repos","events_url":"https://api.github.com/users/qiangxue/events{/privacy}","received_events_url":"https://api.github.com/users/qiangxue/received_events","type":"User","site_admin":false},"open_issues":151,"closed_issues":10,"state":"open","created_at":"2013-10-17T21:06:09Z","updated_at":"2016-08-08T11:35:27Z","due_on":null,"closed_at":null},"comments":32,"created_at":"2014-07-27T20:34:59Z","updated_at":"2016-08-13T23:28:16Z","closed_at":null,"body":"follow up on #303\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/239647038","html_url":"https://github.com/yiisoft/yii2/issues/4479#issuecomment-239647038","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/4479","id":239647038,"user":{"login":"darrencoutts118","id":9951843,"avatar_url":"https://avatars.githubusercontent.com/u/9951843?v=3","gravatar_id":"","url":"https://api.github.com/users/darrencoutts118","html_url":"https://github.com/darrencoutts118","followers_url":"https://api.github.com/users/darrencoutts118/followers","following_url":"https://api.github.com/users/darrencoutts118/following{/other_user}","gists_url":"https://api.github.com/users/darrencoutts118/gists{/gist_id}","starred_url":"https://api.github.com/users/darrencoutts118/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrencoutts118/subscriptions","organizations_url":"https://api.github.com/users/darrencoutts118/orgs","repos_url":"https://api.github.com/users/darrencoutts118/repos","events_url":"https://api.github.com/users/darrencoutts118/events{/privacy}","received_events_url":"https://api.github.com/users/darrencoutts118/received_events","type":"User","site_admin":false},"created_at":"2016-08-13T23:28:16Z","updated_at":"2016-08-13T23:28:16Z","body":"Sounds good Nik - do you have your filter hosted so I could take a look?\n\nSent from my iPhone.\n\nOn 13 Aug 2016, at 23:13, Nik Samokhvalov <notifications@github.com<mailto:notifications@github.com>> wrote:\n\n\nA common way filtering is achieved is by passing GET parameters like the following:\n/users?active=true&role=admin\n\nI think that is wrong way. Names of fields can match with query parameters. I suggest used parameter ?filter in format JSON:\n\n/api/v1/users?filter={\"field\": \"value\"}\n\n\nOperators\n\n  *   !=\n  *   >\n  *   <\n  *   <=\n  *   >=\n  *   % (search by substring)\n\nSettings\nConfigure a filter rule can be via ActiveDataProvider. For example:\n\nreturn new ActiveDataProvider([\n    'query' => $modelClass::find(),\n    'filter' => [\n        'attributes' => [\n            '*', // All attributes are allowed to be filtered,\n            '!bio' // in addition to the attribute \"text\"\n        ]\n    ]\n]);\n\nExamples\n\n/api/v1/users?filter={\"id\": [1,6,46,8], \"active\": 1)\n/api/v1/users?filter={\"!=id\": 13, \"age\": null)\n/api/v1/users?filter={\"email\": \"nik@samokhvalov.info<mailto:nik@samokhvalov.info>)\n/api/v1/users?filter={\">=age\": 18, \"<age\": 30, \"gender\": \"w\", \"%name\": \"Natalie\")\n\n\nWhat do you say? I have this implementation of the filter, ready to send RP.\n\n-\nYou are receiving this because you are subscribed to this thread.\nReply to this email directly, view it on GitHub<https://github.com/yiisoft/yii2/issues/4479#issuecomment-239644140>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AJfaY0peZlGYi-AIOIFrKvOwB576deE1ks5qfkFwgaJpZM4CRWic>.\n\n\nThis email contains information which is confidential and may be privileged. Unless you are the intended addressee (or authorised to receive for the addressee) you may not use, forward, copy or disclose to anyone this email or any information contained in this email. If you have received this email in error, please advise the sender by reply email immediately and delete this email.\n"}}
{"actor":{"display_login":"darrencoutts118"}}