{"action":"created","issue":{"url":"https://api.github.com/repos/wvteijlingen/Spine/issues/9","labels_url":"https://api.github.com/repos/wvteijlingen/Spine/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/wvteijlingen/Spine/issues/9/comments","events_url":"https://api.github.com/repos/wvteijlingen/Spine/issues/9/events","html_url":"https://github.com/wvteijlingen/Spine/issues/9","id":78894328,"number":9,"title":"Retrieving results but result collection is empty","user":{"login":"FabienHenon","id":2079524,"avatar_url":"https://avatars.githubusercontent.com/u/2079524?v=3","gravatar_id":"","url":"https://api.github.com/users/FabienHenon","html_url":"https://github.com/FabienHenon","followers_url":"https://api.github.com/users/FabienHenon/followers","following_url":"https://api.github.com/users/FabienHenon/following{/other_user}","gists_url":"https://api.github.com/users/FabienHenon/gists{/gist_id}","starred_url":"https://api.github.com/users/FabienHenon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FabienHenon/subscriptions","organizations_url":"https://api.github.com/users/FabienHenon/orgs","repos_url":"https://api.github.com/users/FabienHenon/repos","events_url":"https://api.github.com/users/FabienHenon/events{/privacy}","received_events_url":"https://api.github.com/users/FabienHenon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-21T08:38:24Z","updated_at":"2015-05-21T11:43:44Z","closed_at":null,"body":"First, I'd like to thank you for this library!\r\n\r\nHowever, I'm trying to retrieve some data from my server but I got nothing and I can't figure out why because there should be data, and the log is even displaying it (I set all logs to `Debug`).\r\n\r\nHere is my resource : \r\n\r\n```\r\nclass Device : Resource {\r\n    /////////////////////////////////////////////////////////////////////////\r\n    // Entity definition\r\n    dynamic var authId: String?\r\n    dynamic var macAddress: String?\r\n    dynamic var imei: String?\r\n    dynamic var imsi: String?\r\n    dynamic var creationDate: NSDate?\r\n    dynamic var updateDate: NSDate?\r\n    \r\n    override class var resourceType: String {\r\n        return \"devices\"\r\n    }\r\n\r\n    override class var fields: [Field] {\r\n        return fieldsFromDictionary([\r\n            \"authId\": Attribute().serializeAs(\"auth_id\"),\r\n            \"macAddress\": Attribute().serializeAs(\"mac_address\"),\r\n            \"imei\": Attribute().serializeAs(\"imei\"),\r\n            \"imsi\": Attribute().serializeAs(\"imsi\"),\r\n            \"creationDate\": DateAttribute().serializeAs(\"creation_ts\"),\r\n            \"updateDate\": DateAttribute().serializeAs(\"modif_ts\")\r\n            ])\r\n    }\r\n    /////////////////////////////////////////////////////////////////////////\r\n}\r\n```\r\n\r\nAnd here is my code that initializes Spine and executes the first request that should retrieve all `Device`\r\n\r\n```\r\n// baseURL is defined above and is valid\r\nlet spine = Spine(baseURL: baseURL!)\r\n        \r\n        Spine.setLogLevel(.Debug, forDomain: .Spine)\r\n        Spine.setLogLevel(.Debug, forDomain: .Networking)\r\n        Spine.setLogLevel(.Debug, forDomain: .Serializing)\r\n        \r\n        // Registering entities\r\n        spine.registerResource(Device.resourceType) { Device() }\r\n        \r\n        // tests\r\n        spine.find(Device.self).onSuccess { res in\r\n            NSLog(\"Count : \" + String(res.count))         // Displays 0\r\n            for r in res {\r\n                if let device = r as? Device {\r\n                    NSLog(\"Device : \" + device.authId!)     // Code not reached\r\n                }\r\n            }\r\n        }\r\n```\r\n\r\nNow, here are my logs : \r\n```\r\n❕ Info    - Fetching resources using URL: http://myurl/devices/\r\n❕ Info    - GET: http://myurl/devices/\r\n❕ Info    - 200: Optional(http://myurl/devices/)\r\n❔ Debug   - {\"device\":[{\"auth_id\":\"d9e87da5-d2bc-4d5c-a979-2527ee971b07\",\"creation_ts\":\"2014-12-03 03:21:44.222516\",\"id\":\"b60cb2cb-219b-41ae-8f68-f7e338407a0a\",\"imei\":\"imei_test\",\"imsi\":\"imsi_test\",\"mac_address\":\"mac_test\",\"modif_ts\":\"2014-12-03 03:21:44.222516\"},{\"auth_id\":\"0ef3f0b4-487e-40bf-bd03-cd12abc4c748\",\"creation_ts\":\"2014-12-03 04:23:44.73796\",\"id\":\"c1a2ac9b-a7bb-4fff-b1b8-d35e888ea89f\",\"imei\":\"imei_test\",\"imsi\":\"imsi_test\",\"mac_address\":\"mac_test\",\"modif_ts\":\"2014-12-03 04:23:44.73796\"},{\"auth_id\":\"b3e55323-464c-423c-bdd3-5f38515e22b4\",\"creation_ts\":\"2014-12-03 04:29:53.680171\",\"id\":\"18ce7709-0d3c-4746-a74b-80df1b8e1177\",\"imei\":\"mac_test\",\"imsi\":\"imei_test\",\"mac_address\":null,\"modif_ts\":\"2014-12-03 04:29:53.680171\"},{\"auth_id\":\"8e7b2362-2a6c-4a38-81d5-d803ee0e26fa\",\"creation_ts\":\"2014-12-03 04:41:35.734255\",\"id\":\"84973337-3bf3-427d-acfa-849ef1136ecd\",\"imei\":\"imei_test\",\"imsi\":\"imsi_test\",\"mac_address\":\"mac_test\",\"modif_ts\":\"2014-12-03 04:41:35.734255\"},{\"auth_id\":\"f201c61f-e666-415a-8d0e-62798977f089\",\"creation_ts\":\"2015-05-15 11:01:17.254469\",\"id\":\"dfa0ff32-792f-4772-ad12-9fa9715b5c60\",\"imei\":\"imei\",\"imsi\":\"imsi\",\"mac_address\":\"mac address\",\"modif_ts\":\"2015-05-15 11:01:17.254469\"},{\"auth_id\":\"2074c964-00f1-4a77-a34d-2836f5f8b05a\",\"creation_ts\":\"2015-05-15 11:24:33.866635\",\"id\":\"9b83039c-2dba-4428-9d73-3af4ca95def5\",\"imei\":\"imei\",\"imsi\":\"imsi\",\"mac_address\":\"macaddress\",\"modif_ts\":\"2015-05-15 11:24:33.866635\"},{\"auth_id\":\"b66bbf06-cd3c-4d86-abcd-8abb95bce30f\",\"creation_ts\":\"2015-05-15 12:01:25.74062\",\"id\":\"7a58dc86-e3e0-4ae4-8576-f7b5f30f5110\",\"imei\":\"imei\",\"imsi\":\"imsi\",\"mac_address\":\"macaddress\",\"modif_ts\":\"2015-05-15 12:01:25.74062\"}]}\r\n2015-05-21 10:29:52.307 PROJECT[2335:889799] Count : 0\r\n```\r\n\r\nDid I do something wrong?\r\n\r\nThank you!"},"comment":{"url":"https://api.github.com/repos/wvteijlingen/Spine/issues/comments/104238834","html_url":"https://github.com/wvteijlingen/Spine/issues/9#issuecomment-104238834","issue_url":"https://api.github.com/repos/wvteijlingen/Spine/issues/9","id":104238834,"user":{"login":"wvteijlingen","id":1460535,"avatar_url":"https://avatars.githubusercontent.com/u/1460535?v=3","gravatar_id":"","url":"https://api.github.com/users/wvteijlingen","html_url":"https://github.com/wvteijlingen","followers_url":"https://api.github.com/users/wvteijlingen/followers","following_url":"https://api.github.com/users/wvteijlingen/following{/other_user}","gists_url":"https://api.github.com/users/wvteijlingen/gists{/gist_id}","starred_url":"https://api.github.com/users/wvteijlingen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wvteijlingen/subscriptions","organizations_url":"https://api.github.com/users/wvteijlingen/orgs","repos_url":"https://api.github.com/users/wvteijlingen/repos","events_url":"https://api.github.com/users/wvteijlingen/events{/privacy}","received_events_url":"https://api.github.com/users/wvteijlingen/received_events","type":"User","site_admin":false},"created_at":"2015-05-21T11:43:44Z","updated_at":"2015-05-21T11:43:44Z","body":"This library has been created specifically for consuming an API that adheres to the jsonapi.org standard. Your server response does not comply to this format, and thus Spine cannot parse it correctly. Sorry for the confusion, the readme should really be more clear on this requirement.\r\n\r\nIf you have access to to the back-end and still want to use this library you could modify the response format."}}