[wp-trac] [WordPress Trac] #50615: Editor: Create standalone JSON schema for block type definition
WordPress Trac
noreply at wordpress.org
Wed Jul 15 22:07:35 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):
> I think it should probably be something shipped with Core, to properly
version the schema in accordance with the Core version in use. Otherwise,
you'd need to have an argument to version the API endpoint requests with,
and you'd need to always update the API endpoint during the development
cycle of Core if changes are needed.
That makes sense. I could also imagine that there are/will be other
schemas that it would be useful to have accessible outside of a runtime
context. So perhaps a structure like this?
`wp-includes/schemas/block-type.json`
Then for the block types REST API endpoint there would be a method that
loads that json file and decodes it into an associative array (which could
also be used by the block.json validator in the plugin directory).
My understanding is that one reason for doing this would be so that
certain fields could be marked as translatable in the schema. Ironically,
the schema itself (as it currently exists within the REST API endpoint)
has translatable fields, mostly descriptions. I'm not sure how we would
handle those...
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50615#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list