Opened 4 years ago
Closed 4 years ago
#51255 closed enhancement (fixed)
REST API: Support request level validation
Reported by: | TimothyBlynJacobs | Owned by: | TimothyBlynJacobs |
---|---|---|---|
Milestone: | 5.6 | Priority: | normal |
Severity: | normal | Version: | 4.4 |
Component: | REST API | Keywords: | |
Focuses: | Cc: |
Description
Splitting this off from #50244.
We could also support a validate_callback in the register_rest_route on the same level as callback and permission_callback that would take a WP_REST_Request object and do validation for it. This would be helpful for cases where validation has to be done with all the fields together as context, not just individual field validation. We'd do the parameter validation first, and then call validate_callback on the whole request.
Change History (2)
This ticket was mentioned in PR #516 on WordPress/wordpress-develop by TimothyBJacobs.
4 years ago
#1
Note: See
TracTickets for help on using
tickets.
Trac ticket: https://core.trac.wordpress.org/ticket/51255#ticket