The returned format is currently a list of single-item objects.

"image_style_uri": [
  {
    "side_portrait": "http://localhost/sites/default/files/styles/side_portrait/public/pictures/2019-09/Bumblebee.png?itok=xUzSRYWn"
  },
  {
    "thumb_portrait": "http://localhost/sites/default/files/styles/thumb_portrait/public/pictures/2019-09/Bumblebee.png?itok=ovt6clcQ"
  }
]

Couldn't we make it just a single multi-element object?

"image_style_uri": {
  "side_portrait": "http://localhost/sites/default/files/styles/side_portrait/public/pictures/2019-09/Bumblebee.png?itok=xUzSRYWn"
  "thumb_portrait": "http://localhost/sites/default/files/styles/thumb_portrait/public/pictures/2019-09/Bumblebee.png?itok=ovt6clcQ"
}

It's an API break of course, so maybe not until another version.

Comments

Arla created an issue. See original summary.

wells’s picture

Version: 8.x-1.x-dev » 2.0.x-dev

Agreed this would need to be a new major version. Technically 2.x is still in beta but its widely enough used that this change would be disruptive. Open to a patch here if someone wants to work on it but for now I will just be focused on getting a 2.0.0 release out.

wells’s picture

Version: 2.0.x-dev » 3.0.x-dev

I've started a 3.0.x branch for a Drupal 9+ so will target that for this change before an initial release.

  • wells committed 4dadef6 on 3.0.x
    Issue #3106545 by Arla, wells: Simplify field structure (avoid list of...
wells’s picture

Status: Active » Fixed

Ok this change is in 3.0.0-beta1.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.