Ember data: Your server returned a hash with the key 0 but you have no mapping for it

前端 未结 3 1548
名媛妹妹
名媛妹妹 2021-01-21 12:07

I have a simple model and use the RESTadapter to get the data. The JSON request is executed, but then I receive the following error: \"Your server returned a hash with the key

3条回答
  •  鱼传尺愫
    2021-01-21 13:04

    @kiwiupover was 98% right, when having multiple records it should be pluralized to articles:

    {"articles": [
         { 
           "id": 1,
           "title": "Title 1"
         },
         {
           "id": 2,
           "title": "Title 2"
         }
    ]}
    

提交回复
热议问题