Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API Pull] Ensure empty GLA attributes are returned as an object instead of an empty array in the responses. #2455

Conversation

jorgemd24
Copy link
Contributor

Changes proposed in this Pull Request:

Part of #2146

This PR ensures that empty GLA attributes are returned as an empty object instead of an empty array, maintaining consistency in the responses.

Screenshots:

Detailed test instructions:

  1. Remove any attribute mapping set.
  2. Make a request to GET wp-json/wc/v3/products/PRODUCT_ID?gla_syncable=1
  3. Check that gla_attributes is returned as an empty object instead of an empty array.

Additional details:

Changelog entry

@jorgemd24 jorgemd24 self-assigned this Jul 7, 2024
@github-actions github-actions bot added the changelog: tweak Small change, that isn't actually very important. label Jul 7, 2024
Copy link

codecov bot commented Jul 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.7%. Comparing base (d47c264) to head (0642055).
Report is 1 commits behind head on feature/google-api-project.

Additional details and impacted files

Impacted file tree graph

@@                      Coverage Diff                       @@
##             feature/google-api-project   #2455     +/-   ##
==============================================================
+ Coverage                          64.4%   64.7%   +0.3%     
  Complexity                         4551    4551             
==============================================================
  Files                               795     473    -322     
  Lines                             22796   17753   -5043     
  Branches                           1219       0   -1219     
==============================================================
- Hits                              14688   11484   -3204     
+ Misses                             7941    6269   -1672     
+ Partials                            167       0    -167     
Flag Coverage Δ
js-unit-tests ?
php-unit-tests 64.7% <100.0%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
src/Integration/WPCOMProxy.php 70.2% <100.0%> (ø)

... and 322 files with indirect coverage changes

@jorgemd24 jorgemd24 changed the title [[API Pull]] Ensure empty GLA attributes are returned as an object instead of an empty array in the responses. [API Pull] Ensure empty GLA attributes are returned as an object instead of an empty array in the responses. Jul 7, 2024
@jorgemd24 jorgemd24 marked this pull request as ready for review July 7, 2024 10:28
@jorgemd24 jorgemd24 requested a review from a team July 7, 2024 10:31
Copy link
Contributor

@puntope puntope left a comment

Choose a reason for hiding this comment

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

LGTM ✅ I can see the empty array is now an empty object

@jorgemd24 jorgemd24 merged commit bad2524 into feature/google-api-project Jul 8, 2024
14 checks passed
@jorgemd24 jorgemd24 deleted the tweak/gla-attributes-response-empty-array branch July 8, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: tweak Small change, that isn't actually very important.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants