[wp-trac] [WordPress Trac] #50615: Editor: Create standalone JSON schema for block type definition
WordPress Trac
noreply at wordpress.org
Fri Jul 17 03:51:29 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 TimothyBlynJacobs):
I agree with @schlessera, I think a static `.json` file would be very
helpful.
> 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?
That'd definitely be more forward compatible, though I don't think there
are many instances where it'd make sense. Many REST API schema definitions
are dynamic based on what features are enabled for the resource.
> 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...
Yeah the translatable fields would pose an issue. I guess we could run the
`description` fields thru `translate`, but that'd require the strings
somehow being added to GlotPress.
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.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50615#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list