Change in JSON:API Link Entity Handling Breaks Consuming Apps

Created on 20 October 2023, 8 months ago

Problem/Motivation

As of Drupal 9.5.11 the JSON:API output for a link entity looked like this:

"field_internal_link": {
"uri": "entity:node/4940",
"url": "/human_readable/path/my-node",
"title": "",
"options": []
},
"field_external_link": {
"uri": "https://example.com",
"url": "https://example.com",
"title": "",
"options": []
},

In Drupal 10 it looks like this, without the "url: " key:value pair:

"field_internal_link": {
"uri": "entity:node/4940",
"title": "",
"options": []
},
"field_external_link": {
"uri": "https://example.com",
"title": "",
"options": []
},

This breaks consuming apps that expect and use the "url: " value.

Steps to reproduce

  • install Drupal 10x
  • Add a link field to the "Article" content type
  • Create an article and use the new link field
  • Observe the JSON:API output for that node

Proposed resolution

Restore "url: " field to link object in JSON:API

πŸ› Bug report
Status

Active

Version

10.1 ✨

Component
JSON APIΒ  β†’

Last updated 1 day ago

Created by

πŸ‡ΊπŸ‡ΈUnited States the_double_a

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024