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
By default `declared(params)` includes parameters that have `nil` values. If you want to return only the parameters that are not `nil`, you can use the `include_missing` option. By default, `include_missing` is set to `true`. Consider the following API:
You cannot set a custom message option for Default as it requires interpolation `%{option1}: %{value1} is incompatible with %{option2}: %{value2}`. You can change the default error message for Default by changing the `incompatible_option_values` message key inside [en.yml](lib/grape/locale/en.yml)
1613
1631
@@ -2282,7 +2300,6 @@ class API < Grape::API
2282
2300
end
2283
2301
end
2284
2302
post '/statuses'do
2285
-
# ...
2286
2303
logger.info "#{current_user} has statused"
2287
2304
end
2288
2305
end
@@ -2925,9 +2942,7 @@ If a request for a resource is made that triggers the built-in `OPTIONS` handler
2925
2942
only `before` and `after` callbacks will be executed. The remaining callbacks will
2926
2943
be bypassed.
2927
2944
2928
-
#### Examples
2929
-
2930
-
Using a simple `before` block to set a header
2945
+
For example, using a simple `before` block to set a header.
2931
2946
2932
2947
```ruby
2933
2948
before do
@@ -2963,7 +2978,7 @@ class MyAPI < Grape::API
2963
2978
end
2964
2979
```
2965
2980
2966
-
The behaviour is then:
2981
+
The behavior is then:
2967
2982
2968
2983
```bash
2969
2984
GET / # 'root - '
@@ -2991,7 +3006,7 @@ class MyAPI < Grape::API
2991
3006
end
2992
3007
```
2993
3008
2994
-
The behaviour is then:
3009
+
The behavior is then:
2995
3010
2996
3011
```bash
2997
3012
GET /123 # 'Integer'
@@ -3026,7 +3041,7 @@ class Test < Grape::API
3026
3041
end
3027
3042
```
3028
3043
3029
-
The behaviour is then:
3044
+
The behavior is then:
3030
3045
3031
3046
```bash
3032
3047
GET /foo/v1 # 'v1-hello'
@@ -3051,7 +3066,7 @@ class MyAPI < Grape::API
3051
3066
end
3052
3067
```
3053
3068
3054
-
The behaviour is then:
3069
+
The behavior is then:
3055
3070
3056
3071
```bash
3057
3072
GET /greeting # {"greeting":"Hello!"}
@@ -3339,7 +3354,7 @@ describe 'an endpoint that needs helpers stubbed' do
0 commit comments