Skip to content

Commit 2dc78c5

Browse files
committed
add information about server side changes
1 parent 21fe3ab commit 2dc78c5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/integrations/ember-and-json-api.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Integrating with Ember and JSON API
22

33
- [Preparation](./ember-and-json-api.md#preparation)
4-
- [Adapter Changes](./ember-and-json-api.md#adapter-changes)
4+
- [Server-Side Changes](./ember-and-json-api.md#server-side-changes)
5+
- [Adapter Changes](./ember-and-json-api.md#adapter-changes)
56
- [Serializer Changes](./ember-and-json-api.md#serializer-changes)
67
- [Including Nested Resources](./ember-and-json-api.md#including-nested-resources)
78

@@ -12,6 +13,21 @@ Note: This guide assumes that `ember-cli` is used for your ember app.
1213
The JSON API specification calls for hyphens for multi-word separators. AMS uses underscores.
1314
To solve this, in Ember, both the adapter and the serializer will need some modifications:
1415

16+
### Server-Side Changes
17+
18+
there are multiple mimetypes for json that should all be parsed similarly, so
19+
in `config/initializers/mime_types.rb`:
20+
```ruby
21+
api_mime_types = %W(
22+
application/vnd.api+json
23+
text/x-json
24+
application/json
25+
)
26+
27+
Mime::Type.unregister :json
28+
Mime::Type.register 'application/json', :json, api_mime_types
29+
```
30+
1531
### Adapter Changes
1632

1733
```javascript

0 commit comments

Comments
 (0)