#50053 closed enhancement (fixed)
REST API: Support uuid json schema format
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.5 | Priority: | normal |
Severity: | normal | Version: | 4.7 |
Component: | REST API | Keywords: | json-schema good-first-bug has-patch has-unit-tests |
Focuses: | rest-api | Cc: |
Description
We should add support for format: "uuid"
in rest_validate_value_from_schema
. We can use the existing wp_is_uuid
function for validation. And I'd imagine sanitize_text_field
for sanitization.
At the moment, I think we can skip checking for a specific uuid version.
The list of formats is extensible, but uuid
is also included as a format in the latest specs.
Change History (6)
This ticket was mentioned in PR #247 on WordPress/wordpress-develop by johnwatkins0.
4 years ago
#1
#3
@
4 years ago
- Owner set to TimothyBlynJacobs
- Resolution set to fixed
- Status changed from new to closed
In 47753:
TimothyBJacobs commented on PR #247:
4 years ago
#4
Merged in ef05acd, [r47753](https://core.trac.wordpress.org/changeset/47753).
johnwatkins0 commented on PR #247:
4 years ago
#5
Thanks, @TimothyBJacobs !
Note: See
TracTickets for help on using
tickets.
https://core.trac.wordpress.org/ticket/50053
This adds support for the uuid format in WP REST JSON schema. As suggested in the ticket description, the format is validated with
wp_is_uuid
and sanitized withsanitize_text_field
.