diff --git a/docs/integrations/ember-and-json-api.md b/docs/integrations/ember-and-json-api.md index f0e6b5fb..cf2e52ae 100644 --- a/docs/integrations/ember-and-json-api.md +++ b/docs/integrations/ember-and-json-api.md @@ -1,7 +1,8 @@ # Integrating with Ember and JSON API - [Preparation](./ember-and-json-api.md#preparation) - - [Adapter Changes](./ember-and-json-api.md#adapter-changes) + - [Server-Side Changes](./ember-and-json-api.md#server-side-changes) + - [Adapter Changes](./ember-and-json-api.md#adapter-changes) - [Serializer Changes](./ember-and-json-api.md#serializer-changes) - [Including Nested Resources](./ember-and-json-api.md#including-nested-resources) @@ -12,6 +13,21 @@ Note: This guide assumes that `ember-cli` is used for your ember app. The JSON API specification calls for hyphens for multi-word separators. AMS uses underscores. To solve this, in Ember, both the adapter and the serializer will need some modifications: +### Server-Side Changes + +there are multiple mimetypes for json that should all be parsed similarly, so +in `config/initializers/mime_types.rb`: +```ruby +api_mime_types = %W( + application/vnd.api+json + text/x-json + application/json +) + +Mime::Type.unregister :json +Mime::Type.register 'application/json', :json, api_mime_types +``` + ### Adapter Changes ```javascript