Issue #6334 - Add JSONSchema definitions for configuration YAML files
Issue #6334 - Add JSONSchema definitions for configuration YAML files
Currently it is just a basic "Proof of concept" implementation.
In don't know all the configuration options, and very likely I added some deprecated options as well, such as class_name vs actor in suite definition, but I don't know which one is the correct one.
Thanks @Sweetchuck, this is really good initiative.
How can we trigger the validation for this schema?
I think we need to continue on those, deprecated properties are also ok, we don't often break compatibility on configuration level. We just need to make sure that all cases can be handled by the schema.
@DavertMik This is how I use it with PhpStorm:
- https://www.jetbrains.com/help/phpstorm/2021.3/json.html#ws_json_schema_add_custom
- File | Settings | Languages & Frameworks | Schemas and DTDs | JSON Schema Mappings
Are there any schema related differences between the ./codeception.dist.yml and a ./tests/my-suite-01.suite.dist.yml?
@DavertMik
How can we trigger the validation for this schema?
I don't know the details, but some kind of configuration validation already happening without JSONSchema.
For example:
DEPRECATION: 'settings: bootstrap: fake.php' option is deprecated! Replace it with: 'bootstrap: fake.php' (not under settings section). See: https://codeception.com/docs/reference/Configuration
On other projects I use opis/json-schema to validate a data structure against a JSONSchema.
Are there any schema related differences between the ./codeception.dist.yml and a ./tests/my-suite-01.suite.dist.yml?
You could take a look at https://github.com/Codeception/Codeception/blob/5.0/src/Codeception/Configuration.php#L77-L126
Settings that can be set under settings key in codeception.yaml, can be set as top level settings in suite configuration files.
Is there some command line tool for validation? It would be nice to have it in CI.