We are working on providing schemas to developers for block.json JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. and theme.json files. Adding the schema to the top of a JSON file can integrate with code editors to provide tooltips, autocomplete, and validation; making development easier.
Here’s a GIF showing how it works:
Right now we are using the SchemaStore as common place to gather schemas, but we want to move to our repository that will allow better versioning and control. We created a directory on Gutenberg The Gutenberg project is the new Editor Interface for WordPress. The editor improves the process and experience of creating new content, making writing rich content much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom HTML etc. https://wordpress.org/gutenberg/ to contain the schemas and they can be accessed at:
https://github.com/WordPress/gutenberg/tree/trunk/schemas/json
This allows for adding schemas using the awkward URLs:
https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/block.json
https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/theme.json
But we can make them less awkward by taking a page out of Microsoft’s book and use redirects. For Windows Terminal schema, Microsoft uses: https://aka.ms/terminal-profiles-schema that redirects to a GitHub url.
So, the ask is to get a similar redirect setup, using either wp.org
or w.org
domains.
Something like:
https://wp.org/schemas/block.json => https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/block.json
https://wp.org/schemas/theme.json => https://raw.githubusercontent.com/WordPress/gutenberg/trunk/schemas/json/theme.json
And then in the future when we want to version the schema we could add the version to the redirect and point to the tag/branch in the source code related to that release
https://wp.org/schemas/wp5.9/block.json
https://wp.org/schemas/wp5.9/theme.json
Questions? Thoughts?