RestKit-InExtensions icon indicating copy to clipboard operation
RestKit-InExtensions copied to clipboard

Support for grouping responses and requests.

Open matux opened this issue 11 years ago • 1 comments
trafficstars

Right now this is the way you encode responses and requests:

{
  "response": [
      {
          "class": "Notification",
          "keyPath": "notifications"
      },
      {
          "class": "Notification",
          "pathPattern": "/my/api/path/one",
          "method": "GET"
      },
      {
          "class": "Notification",
          "pathPattern": "/my/api/path/two"
      },
      {
          "class": "Notification",
          "pathPattern": "/my/api/path/three",
          "method": "PUT"
      }
    ]
}

I would love to be able to group them since I believe it would make it clearer, especially on projects that contain many different Models.

{
  "response": {
    "Notification": [
      {
        "keyPath": "notifications",
        "method": "GET"
      },
      {
        "pathPattern": "/my/api/path/one",
        "method": "GET"
      },
      {
        "pathPattern": "/my/api/path/two"
      },
      {
        "pathPattern": "/my/api/path/three",
        "method": "PUT"
      }
    ]
  }
}

matux avatar Apr 22 '14 19:04 matux

Also, if the key class isn't available, the class could be deduced from the name of the object containing the responses/requests.

matux avatar Apr 22 '14 19:04 matux