mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 06:37:06 +00:00
REST API: Add more specific error codes for schema validation.
Previously, the majority of JSON Schema validation errors returned a generic `rest_invalid_param` error code. In preparation for #46191, where the underlying validation error code will be exposed, this commit adds specific error codes for each failure scenario. Fixes #52317. git-svn-id: https://develop.svn.wordpress.org/trunk@50007 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -164,7 +164,7 @@ class WP_Test_REST_Controller extends WP_Test_REST_TestCase {
|
||||
);
|
||||
|
||||
$this->assertErrorResponse(
|
||||
'rest_invalid_param',
|
||||
'rest_not_in_enum',
|
||||
rest_validate_request_arg( 'd', $this->request, 'someenum' )
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user