Timothy Jacobs
7f049d3ac1
REST API: Return detailed error information from request validation.
...
Previously, only the first error message for each parameter was made available. Now, all error messages for a parameter are concatenated. Additionally, the detailed error for each parameter is made available in a new `details` section of the validation error. Each error is formatted following the standard REST API error formatting.
The `WP_REST_Server::error_to_response` method has been abstracted out into a standalone function `rest_convert_error_to_response` to allow for reuse by `WP_REST_Request`. The formatted errors now also contain an `additional_data` property which contains the additional error data provided by `WP_Error::get_all_error_data`.
Props dlh, xkon, TimothyBlynJacobs.
Fixes #46191 .
git-svn-id: https://develop.svn.wordpress.org/trunk@50150 602fd350-edb4-49c9-b593-d223f7449a82
2021-02-02 17:26:06 +00:00
..
2020-09-02 00:35:36 +00:00
2020-11-24 20:41:13 +00:00
2020-12-18 14:38:28 +00:00
2020-11-15 13:59:32 +00:00
2021-02-01 18:04:36 +00:00
2020-09-04 07:01:00 +00:00
2021-02-02 00:38:40 +00:00
2019-10-06 15:04:18 +00:00
2020-12-22 07:42:23 +00:00
2021-01-21 01:35:16 +00:00
2020-11-15 17:17:55 +00:00
2020-09-21 14:05:23 +00:00
2021-02-02 05:14:46 +00:00
2020-09-04 07:01:00 +00:00
2020-09-02 00:35:36 +00:00
2020-01-29 00:43:23 +00:00
2020-12-16 00:49:32 +00:00
2020-09-02 00:35:36 +00:00
2021-01-21 12:37:39 +00:00
2020-11-15 13:59:32 +00:00
2021-01-21 01:35:16 +00:00
2020-09-04 07:01:00 +00:00
2020-10-17 16:24:35 +00:00
2020-12-05 15:49:25 +00:00
2020-09-22 12:32:39 +00:00
2020-09-18 13:22:22 +00:00
2020-11-17 20:50:21 +00:00
2020-11-15 13:59:32 +00:00
2016-07-08 14:36:37 +00:00
2018-08-17 01:50:26 +00:00
2020-10-19 23:37:53 +00:00
2020-11-15 13:59:32 +00:00
2020-12-03 20:37:43 +00:00
2020-11-15 13:59:32 +00:00
2020-10-08 21:13:57 +00:00
2020-09-18 14:11:11 +00:00
2021-02-01 23:31:54 +00:00
2021-01-27 23:45:29 +00:00
2020-12-23 15:04:54 +00:00
2021-02-02 17:26:06 +00:00
2020-11-15 13:59:32 +00:00
2020-11-15 13:59:32 +00:00
2019-01-14 04:54:01 +00:00
2021-01-08 15:22:17 +00:00
2020-11-15 13:59:32 +00:00
2020-11-15 13:59:32 +00:00
2021-02-02 00:08:01 +00:00
2020-10-19 23:37:53 +00:00
2020-12-21 20:21:12 +00:00
2020-09-02 00:35:36 +00:00
2020-11-15 13:59:32 +00:00
2021-01-29 00:05:20 +00:00
2020-09-02 00:35:36 +00:00
2020-09-02 00:35:36 +00:00
2020-12-21 17:49:20 +00:00
2020-10-18 23:21:03 +00:00
2020-09-02 00:35:36 +00:00
2020-11-15 13:59:32 +00:00
2021-01-31 18:16:35 +00:00
2020-09-18 13:22:22 +00:00
2021-02-02 13:47:46 +00:00
2020-10-18 17:25:10 +00:00
2020-09-02 00:35:36 +00:00
2020-09-02 00:35:36 +00:00
2020-09-02 00:35:36 +00:00
2020-09-02 00:35:36 +00:00
2020-11-09 19:40:41 +00:00
2021-01-29 19:58:39 +00:00
2021-02-02 00:08:01 +00:00
2020-11-25 04:49:04 +00:00
2020-09-04 07:01:00 +00:00
2021-02-02 00:38:40 +00:00
2020-09-18 10:56:27 +00:00
2020-12-20 15:07:23 +00:00
2021-02-02 00:38:40 +00:00
2020-09-07 04:11:54 +00:00
2020-09-02 00:35:36 +00:00
2020-06-09 19:45:27 +00:00
2021-01-25 01:06:25 +00:00
2020-09-04 07:01:00 +00:00
2021-01-23 23:25:40 +00:00
2020-09-02 00:35:36 +00:00
2021-01-29 20:36:03 +00:00
2020-10-10 01:37:18 +00:00
2020-11-15 13:59:32 +00:00
2020-10-30 04:57:16 +00:00
2020-09-02 00:35:36 +00:00
2020-11-15 13:59:32 +00:00
2020-10-20 02:02:37 +00:00
2020-10-17 16:24:35 +00:00
2020-09-02 00:35:36 +00:00
2020-12-05 15:49:25 +00:00
2020-10-17 16:24:35 +00:00
2020-10-19 15:38:11 +00:00
2019-07-08 00:55:20 +00:00