Overview

This module and Next.js JSON:API (next_jsonapi) both replace the jsonapi.entity_resource controller, so enabling both throws a TypeError at container build and the site cannot bootstrap.

Decoupled Router integration is also rough: it does not report the resolved language (so a client cannot tell which langCode to request), and the jsonapi.individual<code> URL it returns carries a language prefix (<code>/fr/jsonapi/...), which is wrong since language here is chosen by langCode, not the URL. Neither integration is tested.

Proposed resolution

Compose the controllers: extend next_jsonapi controller when it is enabled, and add a compiler pass so this module's controller wins the swap regardless of module order. Implement hook_decoupled_router_info_alter() to add entity.langcode, and add an outbound path processor that strips language prefixes from JSON:API URLs. Add Kernel and Functional test coverage for both integrations, and the two modules to require-dev.

User interface changes

n/a

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lauriii created an issue. See original summary.

lauriii’s picture

Issue summary: View changes

  • lauriii committed 974c075f on 1.0.x
    feat: #3611081 Add compatibility for Decoupled Router and Next.js JSON:...
lauriii’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.