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 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.
Patch Location
lib/action_dispatch/routing/mapper/resources.rb (or an initializer monkey‑patch if overriding locally).
Suggested Fix
Splat options:
resources @resource_type, **options
Call Resource.new with keyword args:
Resource.new(@resource_type, api_only?, @scope[:shallow], only: options[:only], except: options[:except], **options)
Use configured route formatter for path:
options[:path] = JSONAPI.configuration.route_formatter.format(@resource_type)