mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
REST API: Support the patternProperties JSON Schema keyword.
Props yakimun. Fixes #51024. git-svn-id: https://develop.svn.wordpress.org/trunk@49082 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1284,6 +1284,42 @@ class Tests_REST_API extends WP_UnitTestCase {
|
||||
),
|
||||
array( 'additional' => array( 'a' => '1' ) ),
|
||||
),
|
||||
'pattern properties' => array(
|
||||
array(
|
||||
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||
'type' => 'object',
|
||||
'properties' => array(
|
||||
'a' => array(
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
),
|
||||
'patternProperties' => array(
|
||||
'[0-9]' => array(
|
||||
'type' => 'string',
|
||||
'context' => array( 'view', 'edit' ),
|
||||
),
|
||||
'c.*' => array(
|
||||
'type' => 'string',
|
||||
'context' => array( 'edit' ),
|
||||
),
|
||||
),
|
||||
'additionalProperties' => array(
|
||||
'type' => 'string',
|
||||
'context' => array( 'edit' ),
|
||||
),
|
||||
),
|
||||
array(
|
||||
'a' => '1',
|
||||
'b' => '2',
|
||||
'0' => '3',
|
||||
'ca' => '4',
|
||||
),
|
||||
array(
|
||||
'a' => '1',
|
||||
'0' => '3',
|
||||
),
|
||||
),
|
||||
'multiple types object' => array(
|
||||
array(
|
||||
'$schema' => 'http://json-schema.org/draft-04/schema#',
|
||||
|
||||
Reference in New Issue
Block a user