Change record status: 
Project: 
Introduced in branch: 
8.x-2.x
Introduced in version: 
8.x-2.0
Description: 

JSON API decided to leap ahead of core and not wait for core to fix the File entity's missing support for accessing the file entity's public download URL.

JSON API 1.x on Drupal <8.5.x
{
  "data": {
    "type": "file--file",
    "id": "2ba2f3ba-6625-4874-8ec8-6e4327055f84",
    "attributes": {
…
      "url": "/subdir/sites/default/files/drupal.txt",
      "uri": {
        "value": "public://drupal.txt",
      },
…
}
JSON API 1.x on Drupal 8.5.x
(Thanks to Drupal 8.5 shipping with #2825487: Fix normalization of File entities: file entities should expose the file URL as a computed property on the 'uri' base field.)
{
  "data": {
    "type": "file--file",
    "id": "2ba2f3ba-6625-4874-8ec8-6e4327055f84",
    "attributes": {
…
      "url": "/subdir/sites/default/files/drupal.txt",
      "uri": {
        "url": "/subdir/sites/default/files/drupal.txt",
        "value": "public://drupal.txt",
      },
…
}
JSON API 2.x on Drupal >=8.5.x
(Thanks to #2926463: [>=8.5] Remove JSON API's "file URL" field work-around now that Drupal core 8.5 fixed it getting committed to JSON API 2.x.)
{
  "data": {
    "type": "file--file",
    "id": "2ba2f3ba-6625-4874-8ec8-6e4327055f84",
    "attributes": {
…
      "uri": {
        "url": "/subdir/sites/default/files/drupal.txt",
        "value": "public://drupal.txt",
      },
…
}

This means that JSON API consumers talking to JSON API 1.x sites can already be updated to read data.attributes.uri.url, and then when the sites update to JSON API 2.x, there won't be any change.

JSON API 1.x on Drupal <8.5.x
data.attributes.url
JSON API 1.x on Drupal 8.5.x
data.attributes.url

OR

data.attributes.uri.url
JSON API 2.x on Drupal >=8.5.x
data.attributes.uri.url
Impacts: 
Site builders, administrators, editors
Themers