REST API: Support the uuid JSON Schema format.

This accepts a uuid of any version. A future commit could add support for restricting uuids to a specific version.

Props johnwatkins0.
Fixes #50053.


git-svn-id: https://develop.svn.wordpress.org/trunk@47753 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Timothy Jacobs
2020-05-03 19:18:40 +00:00
parent d8371d2134
commit ef05acdfaa
5 changed files with 63 additions and 0 deletions

View File

@@ -69,6 +69,11 @@ class WP_REST_Test_Controller extends WP_REST_Controller {
'format' => 'hex-color',
'context' => array( 'view' ),
),
'someuuid' => array(
'type' => 'string',
'format' => 'uuid',
'context' => array( 'view' ),
),
'someenum' => array(
'type' => 'string',
'enum' => array( 'a', 'b', 'c' ),