-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validation issues with block.json in a few core blocks #35902
Comments
It looks like changes proposed in #35900 helped to find valid issues. I can confirm that
Let me also highlight again my question from #35843 (comment):
Now, that we plan to add schema to all core blocks, we could also create an integration test that would validate all |
@ryanwelcher, this could be also useful to add the |
The schema property was added with WordPress/gutenberg-examples#167 - thanks @mkaz ! |
@gziolo I like the idea of having it internal to Gutenberg repo. We would also want to include the theme.json schema. We can mirror any changes to the SchemaStore URL so any old URLs would still work, plus get better exposure if people look there first,. But the master version would live in Gutenberg repo. Also, in Gutenberg it would get automatic versioning with the tags/branches of each release, |
That's one of the options that could help with maintenance. There are also i18n related config files for Unless @mkaz or @ajlende know how to annotate the translatable fields directly in the schema definition 😄 |
We could add custom fields to the schema file to indicate if the field is translatable or not. Some of the schemas in SchemaStore use a custom |
Checked this one, which was added at #33859 and it appears that |
Same as button above. |
Fix in SchemaStore/schemastore#1903 |
I've also got a PR to address some items being moved into |
We need to extend the schema to allow |
Fix in #36140 |
AFAIK this will land in 5.9 👍 |
I opened #36175 to add |
I opened a follow-up PR SchemaStore/schemastore#1915. I will take care of the last item now:
|
PR ready to review: #36218. That is the last task which should conclude this issue 🎉 |
The `templateLock` attribute is mixed between boolean and string. Setting the type as string introduces an regression that will remove `false` on save. The original PR (#36140) tried to fix a validation issue reported in #35902 The schema error is incorrect. The attribute definition is required to have either a `type` or an `enum`.
Part of #35902. Update the block.json schema to require either a `type` or an `enum` prop.
Part of #35902. Update the block.json schema to require either a `type` or an `enum` prop.
Yes. I'll create a PR so type can both be a string or an array. |
We still have some changes to sync with https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/block.json to be able to consider this issue as done. |
* Revert "Block Library: Fix incorrect attributes definitions #36140" The `templateLock` attribute is mixed between boolean and string. Setting the type as string introduces an regression that will remove `false` on save. The original PR (#36140) tried to fix a validation issue reported in #35902 The schema error is incorrect. The attribute definition is required to have either a `type` or an `enum`. * Spesify type as string or boolean * Add unit test
* Revert "Block Library: Fix incorrect attributes definitions #36140" The `templateLock` attribute is mixed between boolean and string. Setting the type as string introduces an regression that will remove `false` on save. The original PR (#36140) tried to fix a validation issue reported in #35902 The schema error is incorrect. The attribute definition is required to have either a `type` or an `enum`. * Spesify type as string or boolean * Add unit test
* Revert "Block Library: Fix incorrect attributes definitions #36140" The `templateLock` attribute is mixed between boolean and string. Setting the type as string introduces an regression that will remove `false` on save. The original PR (#36140) tried to fix a validation issue reported in #35902 The schema error is incorrect. The attribute definition is required to have either a `type` or an `enum`. * Spesify type as string or boolean * Add unit test
With SchemaStore/schemastore#1930 merged, the SchemaStore file should reference this one. So we don't have to worry about opening a PR for both of them anymore, and I think this can be marked as complete 🙂 |
@ajlende, thank you so much 🎉 |
What problem does this address?
When adding the schema definition to core blocks in #35900 it highlighted the following validation errors in a few core blocks.
I'm not sure if the issues are with the schema definition or invalid properties in the block.json each will need to be investigated, adding this ticket so they are not lost.
The text was updated successfully, but these errors were encountered: