Skip to content

REST API: Add tests verifying media_details.sizes is an object when empty - #13685

Open
robelsust wants to merge 2 commits into
WordPress:trunkfrom
robelsust:fix/65251-rest-media-sizes
Open

robelsust wants to merge 2 commits into
WordPress:trunkfrom
robelsust:fix/65251-rest-media-sizes

Conversation

@robelsust

Copy link
Copy Markdown

This PR adds unit tests verifying that media_details.sizes (and media_details itself) returns an empty object {} when sizes or metadata are empty, ensuring consistency with the JSON schema type object.

Trac ticket: https://core.trac.wordpress.org/ticket/65251

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props therssoftware, huzaifaalmesbah.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@robelsust
robelsust force-pushed the fix/65251-rest-media-sizes branch from 9e982c4 to 6ee8662 Compare September 23, 2026 15:16

@huzaifaalmesbah huzaifaalmesbah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, @robelsust! I really appreciate you locking in both empty object paths in prepare_item_for_response(), neither had a direct test before. Looks good to me.

AI Review: Opus 5.5

@robelsust

Copy link
Copy Markdown
Author

@github-actions refresh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants