Title: Rails 8.1: jsonapi_resources DSL fails to generate relationship routes due to Resource#initialize signature change · Issue #1479 · JSONAPI-Resources/jsonapi-resources · GitHub
Open Graph Title: Rails 8.1: jsonapi_resources DSL fails to generate relationship routes due to Resource#initialize signature change · Issue #1479 · JSONAPI-Resources/jsonapi-resources
X Title: Rails 8.1: jsonapi_resources DSL fails to generate relationship routes due to Resource#initialize signature change · Issue #1479 · JSONAPI-Resources/jsonapi-resources
Description: After upgrading to Rails 8.1.1, JSONAPI‑Resources fails to generate relationship routes. Requests like: raise: RoutingError (No route matches ...) even though the resource is declared with: jsonapi_resources :deal_individuals Cause Rails...
Open Graph Description: After upgrading to Rails 8.1.1, JSONAPI‑Resources fails to generate relationship routes. Requests like: raise: RoutingError (No route matches ...) even though the resource is declared with: jsonapi...
X Description: After upgrading to Rails 8.1.1, JSONAPI‑Resources fails to generate relationship routes. Requests like: raise: RoutingError (No route matches ...) even though the resource is declared with: jsonapi...
Opengraph URL: https://github.com/JSONAPI-Resources/jsonapi-resources/issues/1479
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Rails 8.1: jsonapi_resources DSL fails to generate relationship routes due to Resource#initialize signature change","articleBody":"After upgrading to **Rails 8.1.1**, JSONAPI‑Resources fails to generate relationship routes. \nRequests like:\n\nraise:\n\nRoutingError (No route matches ...)\n\n\neven though the resource is declared with:\n\n```ruby\njsonapi_resources :deal_individuals\n```\n\nCause\nRails 8.1 changed ActionDispatch::Routing::Mapper::Resources::Resource#initialize to require keyword args (only:, except:, **options). The JSONAPI‑Resources DSL still passes a positional options hash, so jsonapi_relationships never runs and relationship routes are missing.\n\nPatch Location\nlib/action_dispatch/routing/mapper/resources.rb (or an initializer monkey‑patch if overriding locally).\n\n\nSuggested Fix\nSplat options:\n\n```ruby\nresources @resource_type, **options\n```\n\nCall Resource.new with keyword args:\n```ruby\nResource.new(@resource_type, api_only?, @scope[:shallow], only: options[:only], except: options[:except], **options)\n```\n\nUse configured route formatter for path:\n```ruby\noptions[:path] = JSONAPI.configuration.route_formatter.format(@resource_type)\n```","author":{"url":"https://github.com/balakirevs","@type":"Person","name":"balakirevs"},"datePublished":"2025-11-08T12:41:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/1479/jsonapi-resources/issues/1479"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:6ced5a54-69a0-9bd8-c3a5-079ac46fbfa1 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B81E:286F17:1220483:18EA811:6A4DE1CA |
| html-safe-nonce | f910a61689d5f4570194acbab0593d272a2fca47f9d78a63e9ae443f43655225 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODFFOjI4NkYxNzoxMjIwNDgzOjE4RUE4MTE6NkE0REUxQ0EiLCJ2aXNpdG9yX2lkIjoiODMyMDI5NDEyODg3NDAyMTMyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fb1a5dade046364528c23fbd91acda67089244d19b05bd8601cfd7f84741f544 |
| hovercard-subject-tag | issue:3603520903 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JSONAPI-Resources/jsonapi-resources/1479/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fb3aa480b1b904219f9bca9640d911e8f62cb72b27996089992a562a5df8ab7f/JSONAPI-Resources/jsonapi-resources/issues/1479 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fb3aa480b1b904219f9bca9640d911e8f62cb72b27996089992a562a5df8ab7f/JSONAPI-Resources/jsonapi-resources/issues/1479 |
| og:image:alt | After upgrading to Rails 8.1.1, JSONAPI‑Resources fails to generate relationship routes. Requests like: raise: RoutingError (No route matches ...) even though the resource is declared with: jsonapi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | balakirevs |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/JSONAPI-Resources/jsonapi-resources git https://github.com/JSONAPI-Resources/jsonapi-resources.git |
| octolytics-dimension-user_id | 262422067 |
| octolytics-dimension-user_login | JSONAPI-Resources |
| octolytics-dimension-repository_id | 18248068 |
| octolytics-dimension-repository_nwo | JSONAPI-Resources/jsonapi-resources |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 18248068 |
| octolytics-dimension-repository_network_root_nwo | JSONAPI-Resources/jsonapi-resources |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width