Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Views Bootstrap 5.5.4 — Minor update available for module views_bootstrap (5.5.4). Release: ChatGPT Ads 1.0.3 — Minor update available for module chatgpt_ads (1.0.3). Release: Opensolr Search 5.1.3 — Minor update available for module opensolr_search (5.1.3). Release: ServiceM8 Webform Integration 1.2.1 — Minor update available for module servicem8_webform (1.2.1). Release: PostfixAdmin 1.0.0 — Initial release available for module postfix_admin (1.0.0)! Release: MCP Sentinel 2.28.2 — Minor update available for module mcp_sentinel (2.28.2). Release: Rightup theme 1.0.2 — Minor update available for theme vartheme_bs5_rightup (1.0.2). Release: ip_analyser 1.0.3 — Minor update available for module ip_analyser (1.0.3). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage. Module Revived: Liquid Voting 2.0.1 — Module liquid_voting updated after 6 months of inactivity (2.0.1).

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.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
2
Tracked since
Sep 2024
Latest release
2 years ago
Releases (12 mo)
0
Maintenance
Dormant

Releases

Version Type Core Release date
2.0.0-alpha4 Pre-release 10–11 Sep 16, 2024
2.0.0-alpha3 Pre-release Sep 4, 2024