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
{{ message }}
Repository navigation
Commit 712b029
Browse filesBrowse the repository at this point in the historyBrowse files
Look up the header versioner's vendor pattern once, when it is built
A request whose Accept header missed the versioner's table read
VendorVersionHeaderRegexCache, a singleton behind a Monitor. The
versioner now passes the pattern down, and Grape::Util::MediaType takes
vendor_pattern: in place of vendor:.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,6 +15,7 @@
15
15
*[#3090](https://github.com/ruby-grape/grape/pull/3090): Call Danger's workflows from danger/danger-pr-comment, where they moved - [@ericproulx](https://github.com/ericproulx).
*[#3095](https://github.com/ruby-grape/grape/pull/3095): Freeze Grape's constants all the way down - [@ericproulx](https://github.com/ericproulx).
18
+
*[#3098](https://github.com/ruby-grape/grape/pull/3098): Look up the header versioner's vendor pattern once, when it is built - [@ericproulx](https://github.com/ericproulx).
Copy file name to clipboardExpand all lines: UPGRADING.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,10 @@ Upgrading Grape
3
3
4
4
### Upgrading to >= 4.2.0
5
5
6
+
#### `Grape::Util::MediaType` parses for a vendor's pattern
7
+
8
+
`Grape::Util::MediaType.parse`, `.best_quality` and `.new` take `vendor_pattern:`, the pattern `Grape::Util::MediaType.vendor_pattern(vendor)` answers, in place of `vendor:` ([#3098](https://github.com/ruby-grape/grape/pull/3098)). The header versioner looks its vendor's pattern up as it is built, so a request no longer reads a cache. Only code calling these internals is affected: pass `vendor_pattern: Grape::Util::MediaType.vendor_pattern(vendor)`.
9
+
6
10
#### A `use` of unknown params raises when the API compiles
7
11
8
12
A mounted API can now `use` the reusable `params` of the scope it is mounted in ([#3087](https://github.com/ruby-grape/grape/pull/3087)). An API's `params` blocks run before it is mounted, so a name `use` cannot find no longer raises `Params :name not found!` as the API class is defined. It raises when the API compiles, either on its first request or at `compile!`. A Rails application that eager loads compiles the APIs mounted in its routes at boot, so a misspelled name still fails the boot there. Elsewhere, call `compile!` on your API at boot, or in a spec, to catch one before a request does.
0 commit comments