[wp-trac] [WordPress Trac] #50615: Editor: Create standalone JSON schema for block type definition
WordPress Trac
noreply at wordpress.org
Wed Jul 8 16:34:50 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 | Keywords:
Focuses: rest-api |
-----------------------------+-----------------------------
There is an existing schema for block type definition embedded in the new
REST API endpoint:
https://github.com/WordPress/wordpress-
develop/blob/c3993eb19dee52dfd6ca9f9ef7cec785538e361d/src/wp-includes
/rest-api/endpoints/class-wp-rest-block-types-controller.php#L363-L569
There is also another schema being developed for Block Directory that will
take part in `block.json` file validation:
https://github.com/tellyworth/plugin-
directory/blob/25388b9c12193194a16db5264ed84f2f3965552e/block-json/class-
validator.php#L36-L182
It would be great to consolidate efforts and make such schema publicly
accessible as it would benefit other projects in the WordPress ecosystem
like WP-CLI. There is a related discussion related to translatable strings
extraction, see https://github.com/wp-cli/i18n-
command/pull/210#issuecomment-634107470
> This kind of schema would need to live somewhere outside of WordPress
context, where WP-CLI and other tools can easily assess which fields in
`block.json` are translatable and which aren't.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50615>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list