TimothyBlynJacobs
8a51ab57e0
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 .
Built from https://develop.svn.wordpress.org/trunk@50150
git-svn-id: http://core.svn.wordpress.org/trunk@49829 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2021-02-02 17:28:02 +00:00
..
2021-02-02 05:17:13 +00:00
2020-12-01 17:03:04 +00:00
2020-12-10 23:27:06 +00:00
2021-02-02 05:17:13 +00:00
2020-08-01 14:09:06 +00:00
2021-02-02 05:17:13 +00:00
2021-01-27 21:03:57 +00:00
2020-07-17 17:11:03 +00:00
2020-11-17 01:00:08 +00:00
2020-12-21 20:23:02 +00:00
2021-02-02 05:17:13 +00:00
2020-11-30 17:10:05 +00:00
2020-12-10 23:59:03 +00:00
2020-10-29 18:00:08 +00:00
2021-02-02 17:28:02 +00:00
2020-10-16 17:20:07 +00:00
2020-10-20 02:22:07 +00:00
2020-12-03 17:41:07 +00:00
2020-10-18 17:33:07 +00:00
2020-07-03 23:42:01 +00:00
2021-01-08 14:30:14 +00:00
2021-01-25 12:53:58 +00:00
2020-10-17 15:45:06 +00:00
2020-11-19 18:24:09 +00:00
2020-07-27 15:14:04 +00:00
2021-01-19 11:50:08 +00:00
2020-11-24 12:29:07 +00:00
2020-07-23 21:55:04 +00:00
2020-11-24 21:27:05 +00:00
2021-02-02 00:40:01 +00:00
2021-02-02 12:13:07 +00:00
2021-01-24 14:07:57 +00:00
2020-07-23 21:55:04 +00:00
2021-01-03 22:04:04 +00:00
2020-11-12 11:17:07 +00:00
2020-07-21 12:58:02 +00:00
2020-10-16 17:20:07 +00:00
2021-01-26 13:45:57 +00:00
2020-10-17 16:05:09 +00:00
2020-10-17 16:05:09 +00:00
2021-01-31 12:50:01 +00:00
2020-10-19 23:39:04 +00:00
2020-08-19 02:46:04 +00:00
2020-06-28 14:02:06 +00:00
2021-01-28 13:10:57 +00:00
2020-06-25 05:16:11 +00:00
2021-02-02 05:17:13 +00:00
2020-10-26 21:51:08 +00:00
2020-10-26 21:51:08 +00:00
2020-10-10 20:02:05 +00:00
2021-01-28 02:04:13 +00:00
2020-07-26 22:17:01 +00:00
2020-10-20 07:54:10 +00:00
2021-02-01 18:06:03 +00:00
2021-01-08 14:30:14 +00:00
2021-01-03 22:04:04 +00:00
2020-10-17 14:54:05 +00:00
2021-01-21 01:37:00 +00:00
2020-10-08 21:15:13 +00:00
2021-01-08 14:30:14 +00:00
2020-10-08 21:15:13 +00:00
2020-11-19 18:24:09 +00:00
2020-07-23 00:48:06 +00:00
2020-11-09 11:17:07 +00:00
2020-07-23 20:01:04 +00:00
2020-10-09 22:30:04 +00:00
2020-11-02 19:55:07 +00:00
2020-11-12 14:36:10 +00:00
2021-01-04 17:18:04 +00:00
2020-07-23 07:39:02 +00:00
2020-10-08 21:15:13 +00:00
2021-01-15 20:08:07 +00:00
2021-01-03 22:04:04 +00:00
2020-06-26 18:40:04 +00:00
2020-11-19 17:54:05 +00:00
2020-11-14 16:35:06 +00:00
2021-02-02 16:53:04 +00:00
2021-01-03 22:04:04 +00:00
2021-01-03 22:04:04 +00:00
2020-07-10 12:46:09 +00:00
2020-11-12 14:43:09 +00:00
2020-09-18 10:37:08 +00:00
2020-10-08 21:15:13 +00:00
2021-01-03 22:04:04 +00:00
2021-01-03 21:57:09 +00:00
2021-01-08 14:30:14 +00:00
2021-01-03 22:04:04 +00:00
2020-11-24 21:22:04 +00:00
2020-11-16 11:04:12 +00:00
2021-01-03 22:04:04 +00:00
2020-12-10 23:59:03 +00:00
2020-11-09 15:15:08 +00:00
2021-01-08 14:30:14 +00:00
2020-08-11 00:34:08 +00:00
2021-01-04 17:18:04 +00:00
2020-08-11 00:34:08 +00:00
2020-08-11 00:34:08 +00:00
2020-11-19 16:15:08 +00:00
2020-07-23 00:52:05 +00:00
2020-07-23 20:01:04 +00:00
2020-08-12 15:05:08 +00:00
2020-12-16 14:05:07 +00:00
2020-10-10 20:02:05 +00:00
2021-01-08 14:30:14 +00:00
2020-07-14 12:10:05 +00:00
2021-02-01 11:55:00 +00:00
2021-01-08 15:24:07 +00:00
2020-12-10 23:53:07 +00:00
2021-01-27 21:53:58 +00:00
2021-01-08 14:30:14 +00:00
2021-01-08 14:30:14 +00:00
2020-12-10 23:59:03 +00:00
2020-11-05 18:46:10 +00:00
2021-01-08 14:30:14 +00:00
2021-01-03 22:04:04 +00:00
2021-01-08 14:30:14 +00:00
2020-12-06 02:21:07 +00:00
2021-01-05 17:16:11 +00:00
2021-01-31 17:36:57 +00:00
2020-10-18 17:27:06 +00:00
2021-02-02 13:49:03 +00:00
2020-10-20 02:04:07 +00:00
2021-02-02 00:10:01 +00:00
2021-02-02 16:53:04 +00:00
2021-01-26 18:54:59 +00:00
2020-11-03 17:36:09 +00:00
2020-07-23 19:06:03 +00:00
2020-11-12 14:36:10 +00:00
2021-01-17 16:38:06 +00:00
2021-02-02 17:10:04 +00:00
2020-12-06 02:21:07 +00:00
2021-01-26 18:54:59 +00:00
2020-10-08 21:15:13 +00:00
2021-01-29 20:00:02 +00:00
2021-02-02 00:10:01 +00:00
2021-01-03 22:04:04 +00:00
2021-01-15 20:08:07 +00:00
2021-02-02 00:40:01 +00:00
2021-01-28 11:05:58 +00:00
2020-12-16 12:45:11 +00:00
2021-02-02 17:10:04 +00:00
2021-01-03 22:04:04 +00:00
2020-10-17 16:05:09 +00:00
2020-07-05 11:21:03 +00:00
2020-11-19 18:24:09 +00:00
2021-01-05 17:16:11 +00:00
2020-10-18 20:53:08 +00:00
2020-10-18 17:27:06 +00:00
2021-01-03 22:04:04 +00:00
2021-01-03 22:04:04 +00:00
2021-01-25 01:23:58 +00:00
2021-01-07 14:17:11 +00:00
2021-01-27 21:53:58 +00:00
2021-01-04 17:18:04 +00:00
2020-11-24 21:27:05 +00:00
2021-02-01 21:22:02 +00:00
2020-11-24 21:27:05 +00:00
2021-02-01 23:33:02 +00:00
2021-01-03 22:04:04 +00:00
2020-11-12 11:17:07 +00:00
2020-11-12 11:17:07 +00:00
2021-02-02 17:28:02 +00:00
2020-10-08 21:15:13 +00:00
2020-11-19 16:15:08 +00:00
2021-01-29 20:38:03 +00:00
2020-11-16 22:52:05 +00:00
2021-01-04 17:18:04 +00:00
2021-02-01 22:13:03 +00:00
2021-01-15 20:08:07 +00:00
2020-08-27 01:30:04 +00:00
2020-11-12 11:17:07 +00:00
2021-02-01 14:13:00 +00:00
2020-07-07 11:01:59 +00:00
2021-01-05 16:48:07 +00:00
2021-01-30 10:34:02 +00:00
2021-02-02 12:43:04 +00:00
2020-10-08 21:15:13 +00:00
2021-02-02 17:28:02 +00:00
2021-01-15 20:08:07 +00:00
2021-01-07 14:17:11 +00:00