[wp-trac] [WordPress Trac] #35574: Add REST API JSON schema information to WP_Widget

WordPress Trac noreply at wordpress.org
Tue Apr 11 06:07:49 UTC 2017


#35574: Add REST API JSON schema information to WP_Widget
------------------------------------------+-----------------------------
 Reporter:  westonruter                   |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Future Release
Component:  Widgets                       |     Version:  2.8
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch needs-unit-tests  |     Focuses:  rest-api
------------------------------------------+-----------------------------

Comment (by rmccue):

 IMO, if it returns something similar but not identical, it shouldn't be
 called the same thing. If it's not a full schema object, it should
 definitely be called something different. Potentially, `WP_Wiget` could
 have the `get_item_schema` which adds those properties automatically, with
 `properties => $this->get_schema_for_properties()`

 Also, I haven't mentioned this here previously, but I have in Slack: I am
 -1 on reusing JSON Schema directly for internal usage. Using JSON Schema
 ties the internal behaviour of WordPress to a single serialisation
 formation (JSON) which doesn't have the same semantics as internal PHP
 types. I would rather we design our own type system which matches our
 requirements, which has JSON Schema as an output format.

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


More information about the wp-trac mailing list