[wp-trac] [WordPress Trac] #35028: WP_Error objects returned by REST API validation callbacks aren't formatted correctly
WordPress Trac
noreply at wordpress.org
Fri Dec 11 23:22:07 UTC 2015
#35028: WP_Error objects returned by REST API validation callbacks aren't formatted
correctly
--------------------------+-----------------------------
Reporter: bradyvercher | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: REST API | Version: 4.4
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
Here's an example response with two missing parameters. The `software_id`
validation callback returns a `WP_Error` instance, while the
`software_version` is required, but doesn't have a validation callback
defined.
{{{
{
"code":"rest_invalid_param",
"message":"Invalid parameter(s): software_id (Invalid software
identifier.), Invalid parameter.",
"data":{
"status":400,
"params":{
"0":"software_id (Invalid software identifier.)",
"software_version":"Invalid parameter."
}
}
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35028>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list