Block JSON schema: Update shadow definition
#58910
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up #58306
What?
This PR updates the definition of the shadow property in the block.json schema.
Why?
Current schema allows boolean or object. I think the reason object is allowed is because it assumes the
__experimentalSkipSerializationproperty. However, this property is not exposed on block.json schema. Furthermore, it is not possible to read from the schema whether the default value ofshadowis true or false.How?
I changed the type back to boolean only and defined the default value as false.I initially simply changed the type to a
booleanvalue as below, but this seems to cause unit tests to fail.This is because the actual block.json also defines an object with the
__experimentalSkipSerializationproperty, even though the schema expects onlybooleantype.Therefore, in this PR, I limited ourselves to adding the default value (
false) and description. Ideally, we might need to update the unit test logic to exclude properties with the__experimentalprefix before validating the schema.Testing Instructions
Verify that the code editor displays the correct definition using the file below.
{ "$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/block-schema/shadow-boolean/schemas/json/block.json", "apiVersion": 2, "name": "test/test", "title": "Test", "supports": { } }Screenshots or screencast
63be096f0d8789702923819396dc8493.mp4