This is ember data 1.13.9 and newer.....
Here's my problem. My server will send responses that look like this (truncated for brevity):
{"response":
{"status": "ok",
"errors": false,
"warnings": false,
"recordcount": 44,
"err_msg": "",
"results": [
{"city": "Rock Hill",
"zipcode": "111",
"storetaxondelivery": null,
"storetaxonpickup": null,
"stateid": "SC"},
{"city": "MILLERTON",
"zipcode": "12546",
"storetaxondelivery": null,
"storetaxonpickup": null,
"stateid": "NY"},
],
"limit": 100,
"offset": 0}
}
The whole of serializers and adapters seem to make a primary assumption that just doesn't hold in my case...which is that the model name is somehow in the JSON response...for the API I'm working with, the resource type is inferred from the URI (i.e. server/zipcode/query in this case).
I realize that I can probably solve this by creating model-specific serializers and overriding modelNameFromPayloadKey or something, but that shouldn't be necessary. Maybe I'm missing where to accomplish this but apparently normalizeResponse is too late. Help?
Aucun commentaire:
Enregistrer un commentaire