-
Notifications
You must be signed in to change notification settings - Fork 219
Return null or object for ImageAttachmentSchema response #9962
Return null or object for ImageAttachmentSchema response #9962
Conversation
The release ZIP for this PR is accessible via:
Script Dependencies ReportThere is no changed script dependency between this branch and trunk. This comment was automatically generated by the TypeScript Errors Report
🎉 🎉 This PR does not introduce new TS errors. |
Size Change: 0 B Total Size: 1.35 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docblock needs changing but yes, this is what was needed.
Can we ensure that all consumers of these endpoints continue to function before merging. I don't think it will break any backwards compatibility because it would I think be treated as an object anyway, but let's be certain.
Test wise, you could test the response for the cart endpoint and ensure that images are either null or received as an object with said properties. This would be added to the PHP test suite.
Thanks for your review, @mikejolley. I just added the
Thanks for pointing this out. I'll create additional test cases to guarantee that this change will remain backwards compatible. |
29af5e4
to
fd3c543
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests 🥇
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
fd3c543
to
df08bf3
Compare
Thanks for your reviews, @mikejolley and @opr! 🙌 |
Fixes #9908
In #9908, @whywilson reported:
Testing
Automated Tests
The affected unit test can be executed using the following commands:
User Facing Testing
[YOUR-URL]/wp-json/wc/store/products/categories
and replace[YOUR-URL]
with the URL of your test site.[YOUR-URL]/wp-json/wc/store/products/categories/[ID]
and replace[ID]
with the ID of the test product category.WooCommerce Visibility
Changelog