This project is not covered by Drupal’s security advisory policy.
JSON:API reference provides a field type Typed Resource Object, that is similar to an entity reference field. However, rather than refer to an entity on the same Drupal installation, this refers to a resource object exposed via JSON:API.
For example - if you are syndicating content from one system to another, you may want to create a typed resource object field on the user entity type on the source system, which refers to the corresponding user on the destination system.
You then may want to add a typed resource object field to the content types from which you are syndicating on the source system so that you can record the relationship to the newly created content in the future.
The module provides an autocomplete widget that looks up resources in the remote system as you type and suggests . Because different types of resource object will autocomplete by comparing the user input against a different attribute, the attribute against which autocompletion takes place is configured in the widget.
Check out a demo at https://youtu.be/MrDHyEkJv3w
Caveats & Assumptions
- The module assumes that all fields come from the same remote system
- The module assumes that authentication is done by basic authentication on the remote system
- The module has not been tested against non-Drupal remote systems, this probably wouldn't work due to reliance on Drupalisms in Drupal's implementation of JSON:API
- The module does not provide any Field Formatters so currently displays the GUID of the resource object as text
Versions
The 2.0.x branch is recommended but requires PHP 8.1. New features will be added to this branch. The 8.x-1.0 branch is only for those who are not yet using PHP 8.1.
The latest 2.0.x alpha breaks compatibility with 8.x-1.0 with the shape of the JsonApiClient::search() response, so changes may be required when upgrading from 8.x-1.x to 2.0.x.
Testing/Evaluation
There is now a Drupal Recipe that sets up JSON:API Reference for easy manual testing or evaluation available at https://www.drupal.org/project/test_jar.
This should not be used for production, but applying this recipe will configure your site for easy testing or evaluation of the module.
Project information
- Project categories: Decoupled, Integrations, Site structure
- Ecosystem: JSON:API
58 sites report using this module
- Created by eli-t on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
First release supporting Drupal 11.
Development version: 2.0.x-dev updated 14 Oct 2024 at 09:51 UTC
Adds support for Drupal 10
Development version: 8.x-1.x-dev updated 13 Sep 2022 at 13:43 UTC

