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
The AMS grape formatter relies on the existence of `env['grape.request']` which is implemeted by `Grape::Middleware::Globals`. You can meet his dependency by calling it before mounting the endpoints.
2
+
3
+
In the simpliest way:
4
+
5
+
```
6
+
class API < Grape::API
7
+
# @note Make sure this is above you're first +mount+
8
+
use Grape::Middleware::Globals
9
+
end
10
+
```
11
+
12
+
or more like what is shown in current Grape tutorials:
13
+
14
+
```
15
+
module MyApi
16
+
class ApiBase < Grape::API
17
+
use Grape::Middleware::Globals
18
+
19
+
require 'grape/active_model_serializers'
20
+
include Grape::ActiveModelSerializers
21
+
22
+
mount MyApi::V1::ApiBase
23
+
end
24
+
end
25
+
```
26
+
27
+
You could meet this dependency with your own middleware. The invocation might look like:
0 commit comments