[wp-trac] [WordPress Trac] #44949: Add support for JSON Schema string pattern to REST API

WordPress Trac noreply at wordpress.org
Sat Sep 15 04:54:32 UTC 2018


#44949: Add support for JSON Schema string pattern to REST API
----------------------------------------+------------------------------
 Reporter:  jason_the_adams             |       Owner:  (none)
     Type:  enhancement                 |      Status:  new
 Priority:  normal                      |   Milestone:  Awaiting Review
Component:  REST API                    |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+------------------------------
Changes (by TimothyBlynJacobs):

 * keywords:  has-patch => has-patch needs-unit-tests


Comment:

 I definitely think we should add this.

 I believe the patch should be changed so that the `pattern` does not need
 the regex delimiters. We should then probably `preg_quote()` the pattern
 before attaching our own delimiters.

 [Spec](https://json-schema.org/latest/json-schema-
 validation.html#regexInterop)
 [Examples](https://json-schema.org/understanding-json-
 schema/reference/regular_expressions.html)

 This will need unit tests.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44949#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list