Skip to content

Commit 3cf89cf

Browse files
authored
Merge pull request #1824 from ruby-grape/upgrading-description
Modifies Upgrading.MD for opening/closing Grape
2 parents fadabec + 8b00bee commit 3cf89cf

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

UPGRADING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ with a class that can contain several instances of `Grape::API`.
1212
This changes were done in such a way that no code-changes should be required.
1313
However, if experiencing problems, or relying on private methods and internal behaviour too deeply, it is possible to restore the prior behaviour by replacing the references from `Grape::API` to `Grape::API::Instance`.
1414

15+
Note, this is particularly relevant if you are opening the class `Grape::API` for modification.
16+
17+
**Deprecated**
18+
```ruby
19+
class Grape::API
20+
# your patched logic
21+
...
22+
end
23+
```
24+
**New**
25+
```ruby
26+
class Grape::API::Instance
27+
# your patched logic
28+
...
29+
end
30+
```
31+
1532
#### Changes in rescue_from returned object
1633

1734
Grape will now check the object returned from `rescue_from` and ensure that it is a `Rack::Response`. That makes sure response is valid and avoids exposing service information. Change any code that invoked `Rack::Response.new(...).finish` in a custom `rescue_from` block to `Rack::Response.new(...)` to comply with the validation.

0 commit comments

Comments
 (0)