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
Validate missing fields in Store API #45840
Conversation
Test Results SummaryCommit SHA: 1fd8e60
To view the full API test report, click here. To view the full E2E test report, click here. To view all test reports, visit the WooCommerce Test Reports Dashboard. |
c6ae01f
to
608c999
Compare
Hi @wavvves, Apart from reviewing the code changes, please make sure to review the testing instructions as well. You can follow this guide to find out what good testing instructions should look like: |
@@ -38,7 +38,7 @@ class CheckoutFields { | |||
* |
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.
This file has no changes.
@@ -383,12 +383,14 @@ public function validate_additional_fields( $fields, $request ) { | |||
$fields = $this->sanitize_additional_fields( $fields ); | |||
$additional_field_schema = $this->get_additional_fields_schema(); | |||
|
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.
Changes are starting from here.
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.
LGTM 👍🏼
Changes proposed in this Pull Request:
In additional fields, we would only validate passed fields, this means required missing fields would not get validated, this fixes it and enable the test for it.
Closes #45496
How to test the changes in this Pull Request:
Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions: