Problem/Motivation

I am using Custom Field and JSON:API on a decoupled site, I installed JSON:API Image Styles to add image styles to my decoupled front end, but this doesn't work with Custom Field's JSON:API integration.

Steps to reproduce

Proposed resolution

Add support for JSON:API Image Styles to custom_field_jsonapi.

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

longwave created an issue. See original summary.

longwave’s picture

Status: Active » Needs review

This MR was assisted by Claude Code.

apmsooner’s picture

Dave, I think this would error if media is disabled though?

longwave’s picture

Where will the error be? use statements and instanceof are safe if the class doesn't exist: https://3v4l.org/vnJHp

apmsooner’s picture

Yeah, thanks for the assurance. Okay, I'll review in a little bit and get it through. Thanks for the commit.

apmsooner’s picture

Status: Needs review » Fixed

Noting that 'image' sub-fields were already supported as the normalizer was already recognizing the base field added by jsonapi_image_styles. Testing this out now verifies that entity_reference sub-fields of type 'media' are now also including the styles.

Thanks @longwave!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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