Add decoupled_router compatibility test and fix next_jsonapi controller collision

  • Add DecoupledRouterCompatibilityTest (Kernel): resolve a translated path alias through decoupled_router's route and assert jsonapi_multilingual serves the correct translation's field values for the resolved entity via langCode.

  • Expose the resolved language to decoupled clients. decoupled_router resolves the entity in its negotiated language but does not report it, so a client could only infer it from the URL prefix. Implement hook_decoupled_router_info_alter() to add entity.langcode to the response, and drive the test's langCode from it.

  • Keep JSON:API URLs language-neutral. decoupled_router must be called under a language prefix to resolve a translated alias, so the jsonapi.individual URL it returns inherited that prefix (/fr/jsonapi/...). Add an outbound path processor that strips language path prefixes from JSON:API paths, since this module selects language by langCode, not URL negotiation. The Kernel test asserts the returned individual path has no language prefix.

  • Fix a TypeError when next_jsonapi is co-installed. Both modules replace the @internal jsonapi.entity_resource controller by setClass(), so the last service provider to run wins and the other module's setter injection targets a class that lacks it. jsonapi_multilingual's controller now extends next_jsonapi's when next_jsonapi is enabled (conditional class_alias), and a new EntityResourceComposePass forces it to win the swap after every alter(), so both modules' behavior and all setters resolve.

  • Add next_jsonapi coverage: a dedicated NextJsonapiCompatibilityTest asserting both behaviors survive on the composed controller (translation selection and next_jsonapi's page-size widening), plus next_jsonapi in the CompatibilityTest companions.

  • Add drupal/decoupled_router and drupal/next to require-dev so CI installs the test dependencies.

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

Closes #3611081

Merge request reports

Loading