You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Good to see that there is a central repository for this purpose 👍
I wrote some schema definition for myself, and I have been using it for quite a while, but I have never published them.
8.extension.info.schema.yml
9.extension.info.schema.yml
9.extension.libraries.schema.yml
9.extension.links.action.schema.yml
9.extension.links.task.schema.yml
I had a plan to publish them on schemastore.org, but the workflow was difficult.
Version numbers
Time to time these schema definitions are changing, mostly with major, or minor releases.
In ideal world these kind of schema definition would be shipped by Drupal core and contrib modules. Maybe even dynamically generated.
For example the used/available keys in *.info.yml are depend on the actual codebase or enabled modules. When the locale module is enabled the interface translation project and interface translation server pattern are also a valid keys.
Not just those listed here
The point is that, a simple ./schema/drupal/info.yml.json is not enough, because the available or required keys in *.info.yml are different for Drupal 8, 9 and 10.
For example the core_version_requirement was not exists in Drupal 8, but it is required in Drupal 10.
Solution could be one of the following:
add prefix to the file names ./schema/drupal/10-info.yml.json
add suffix to the file names ./schema/drupal/info.yml-10.json
add suffix to the directory name (assuming that it is the project name the schema belong s to) ./schema/drupal-10/info.yml.json
In my local schema definitions the core_version_requirement is also required like here
The problem is that when I configure my editor (PHPStorm) to use that schema for every *.info.yml in the project, then when I open an info.yml form the core (e.g.: node.info.yml) then I get this error message:
Not a big deal, at least it is not the fault of the schema definition. It is still useful everywhere else, except core.
File names end with .schema.json
When the file names are end with .schema.json then it is easier to attach the http://json-schema.org/draft-07/schema validation to the files and get more help from the IDE.
JSON vs YAML
I don't know too much about tooling ecosystem around the JSONSchema definitions, maybe some tooling does not support the YAML format, but I would prefer to maintain these definitions in YAML.
The text was updated successfully, but these errors were encountered:
Hello
Good to see that there is a central repository for this purpose 👍
I wrote some schema definition for myself, and I have been using it for quite a while, but I have never published them.
I had a plan to publish them on schemastore.org, but the workflow was difficult.
Version numbers
Time to time these schema definitions are changing, mostly with major, or minor releases.
In ideal world these kind of schema definition would be shipped by Drupal core and contrib modules. Maybe even dynamically generated.
For example the used/available keys in
*.info.yml
are depend on the actual codebase or enabled modules. When thelocale
module is enabled theinterface translation project
andinterface translation server pattern
are also a valid keys.Not just those listed here
The point is that, a simple ./schema/drupal/info.yml.json is not enough, because the available or required keys in
*.info.yml
are different for Drupal 8, 9 and 10.For example the
core_version_requirement
was not exists in Drupal 8, but it is required in Drupal 10.Solution could be one of the following:
./schema/drupal/10-info.yml.json
./schema/drupal/info.yml-10.json
./schema/drupal-10/info.yml.json
./schema/drupal/10/info.yml.json
required core_version_requirement
In my local schema definitions the
core_version_requirement
is also required like hereThe problem is that when I configure my editor (PHPStorm) to use that schema for every
*.info.yml
in the project, then when I open an info.yml form the core (e.g.: node.info.yml) then I get this error message:Not a big deal, at least it is not the fault of the schema definition. It is still useful everywhere else, except core.
File names end with .schema.json
When the file names are end with
.schema.json
then it is easier to attach thehttp://json-schema.org/draft-07/schema
validation to the files and get more help from the IDE.JSON vs YAML
I don't know too much about tooling ecosystem around the JSONSchema definitions, maybe some tooling does not support the YAML format, but I would prefer to maintain these definitions in YAML.
The text was updated successfully, but these errors were encountered: