You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can disable parsing for a content-type with `nil`. For example, `parser :json, nil` will disable JSON parsing altogether. The request data is then available as-is in `env['api.request.body']`.
2566
2567
2568
+
## JSON and XML Processors
2569
+
2570
+
Grape uses `JSON` and `ActiveSupport::XmlMini` for JSON and XML parsing by default. It also detects and supports [multi_json](https://github.com/intridea/multi_json) and [multi_xml](https://github.com/sferik/multi_xml). Adding those gems to your Gemfile will automatically enable them and allow you to swap the JSON and XML back-ends.
2571
+
2567
2572
## RESTful Model Representations
2568
2573
2569
2574
Grape supports a range of ways to present your data with some help from a generic `present` method,
Copy file name to clipboardExpand all lines: UPGRADING.md
+8
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,14 @@ Upgrading Grape
3
3
4
4
### Upgrading to >= 1.0.0
5
5
6
+
#### Changes in XML and JSON Parsers
7
+
8
+
Grape no longer uses `multi_json` or `multi_xml` by default and uses `JSON` and `ActiveSupport::XmlMini` instead. This has no visible impact on JSON processing, but the default behavior of the XML parser has changed. For example, an XML POST containing `<user>Bobby T.</user>` was parsed as `Bobby T.` with `multi_xml`, and as now parsed as `{"__content__"=>"Bobby T."}` with `XmlMini`.
9
+
10
+
To restore previous behavior, add `multi_json` or `multi_xml` to your `Gemfile`, Grape will auto-detect it.
11
+
12
+
See [#1623](https://github.com/ruby-grape/grape/pull/1623) for more information.
13
+
6
14
#### Changes in Parameter Class
7
15
8
16
The default class for `params` has changed from `Hashie::Mash` to `ActiveSupport::HashWithIndifferentAccess` and the `hashie` dependency has been removed. This means that by default you can no longer access parameters by method name.
0 commit comments