{"action":"created","issue":{"url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/issues/68","labels_url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/issues/68/comments","events_url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/issues/68/events","html_url":"https://github.com/strongloop/loopback-sdk-ios/pull/68","id":113046619,"number":68,"title":"Necessary changes to support PersistedModel.updateAll","user":{"login":"hideya","id":321713,"avatar_url":"https://avatars.githubusercontent.com/u/321713?v=3","gravatar_id":"","url":"https://api.github.com/users/hideya","html_url":"https://github.com/hideya","followers_url":"https://api.github.com/users/hideya/followers","following_url":"https://api.github.com/users/hideya/following{/other_user}","gists_url":"https://api.github.com/users/hideya/gists{/gist_id}","starred_url":"https://api.github.com/users/hideya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hideya/subscriptions","organizations_url":"https://api.github.com/users/hideya/orgs","repos_url":"https://api.github.com/users/hideya/repos","events_url":"https://api.github.com/users/hideya/events{/privacy}","received_events_url":"https://api.github.com/users/hideya/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/labels/%23review","name":"#review","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-23T15:49:03Z","updated_at":"2015-10-23T21:16:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/pulls/68","html_url":"https://github.com/strongloop/loopback-sdk-ios/pull/68","diff_url":"https://github.com/strongloop/loopback-sdk-ios/pull/68.diff","patch_url":"https://github.com/strongloop/loopback-sdk-ios/pull/68.patch"},"body":"There are cases where some of the parameters go to the query string whereas the others go to the message body after JSON encoding.  One of such example is PersistedModel.updateAll:\r\n\r\nhttps://github.com/strongloop/loopback/blob/32085475ed027f5a225e8023a69c98f1950cb7b9/lib/persisted-model.js#L635-L639\r\n```\r\naccepts: [\r\n  {arg: 'where', type: 'object', http: {source: 'query'}, description: '...'},\r\n  {arg: 'data', type: 'object', http: {source: 'body'}, description: '...'},\r\n],\r\n```\r\n`where` has `http.source: query`, therefore it should be encoded into the query string.\r\n`data` has `http.source: body`, therefore it should be encoded via AFJSONParameterEncoding and put into the request body.\r\n\r\nHowever, the current `SLRESTAdapter`'s `invokeStaticMethod` and `invokeInstanceMethod` implementations don't support such parameter handling -- the both process all the parameters with AFJSONParameterEncoding when the verb is PUT or POST.\r\n\r\nThis PR introduces `jsonParameters` argument that explicitly specifies the parameters that need to go to the request body.\r\n\r\n@raymondfeng would you please review the changes?"},"comment":{"url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/issues/comments/150694537","html_url":"https://github.com/strongloop/loopback-sdk-ios/pull/68#issuecomment-150694537","issue_url":"https://api.github.com/repos/strongloop/loopback-sdk-ios/issues/68","id":150694537,"user":{"login":"hideya","id":321713,"avatar_url":"https://avatars.githubusercontent.com/u/321713?v=3","gravatar_id":"","url":"https://api.github.com/users/hideya","html_url":"https://github.com/hideya","followers_url":"https://api.github.com/users/hideya/followers","following_url":"https://api.github.com/users/hideya/following{/other_user}","gists_url":"https://api.github.com/users/hideya/gists{/gist_id}","starred_url":"https://api.github.com/users/hideya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hideya/subscriptions","organizations_url":"https://api.github.com/users/hideya/orgs","repos_url":"https://api.github.com/users/hideya/repos","events_url":"https://api.github.com/users/hideya/events{/privacy}","received_events_url":"https://api.github.com/users/hideya/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T21:16:07Z","updated_at":"2015-10-23T21:16:07Z","body":"> Maybe call it as `bodyParameter`?\r\n\r\nThat's sounds better!  Thanks.  I'll update the name quickly."}}