1

I am starting out fresh into ember.js. I have started out with developing a basic RESTful application using json-server as the data server.

After going through number of documentations, It seems ember has standardized a format for JSON response format from the server and is incompatible with "json-server" by itself.

Is there any possibility of handling this in the ember side ?

Ember version: 1.13

Here is my current error log:

ember.debug.js:30195 Error while processing route: tasks.index Assertion Failed: normalizeResponse must return a valid JSON API document:
* One or more of the following keys must be present: "data", "errors", "meta". Error: Assertion Failed: normalizeResponse must return a valid JSON API document:
* One or more of the following keys must be present: "data", "errors", "meta".
at new Error (native)
Sudhir Shrestha
  • 1,106
  • 1
  • 12
  • 25
  • You will need to customize your adapter ( https://guides.emberjs.com/v2.5.0/models/customizing-adapters/ ) and/or serializer ( https://guides.emberjs.com/v2.5.0/models/customizing-serializers/ ) to conform to your server. – Thernys May 04 '16 at 08:25

1 Answers1

2

Place this in app/serializers/application.js

import DS from 'ember-data';

export default DS.JSONSerializer;
Prakash
  • 581
  • 5
  • 16