[wp-trac] [WordPress Trac] #50615: Editor: Create standalone JSON schema for block type definition

WordPress Trac noreply at wordpress.org
Fri Jul 17 20:59:03 UTC 2020


#50615: Editor: Create standalone JSON schema for block type definition
-----------------------------+------------------------------
 Reporter:  gziolo           |       Owner:  (none)
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Editor           |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:  rest-api
-----------------------------+------------------------------

Comment (by coreymckrill):

 > Many REST API schema definitions are dynamic based on what features are
 enabled for the resource.

 Good point. Though if the schema in the json file was comprehensive, it
 could be whittled down in the `get_item_schema` method after decoding the
 json to a PHP array, based on the current state.

 > Another potential issue with loading from a .json file would be if
 Gutenberg is active the plugin could need a way to add more fields to the
 schema.

 Yeah, there would need to be an `apply_filters` call sometime after
 decoding the json to PHP.

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


More information about the wp-trac mailing list