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
Issue #6334 - Add JSONSchema definitions for configuration YAML files #6335
base: 4.1
Are you sure you want to change the base?
Conversation
Currently it is just a basic "Proof of concept" implementation. |
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:
|
c9509cf
to
95affb3
Compare
Are there any schema related differences between the |
I don't know the details, but some kind of configuration validation already happening without JSONSchema. For example:
On other projects I use opis/json-schema to validate a data structure against a JSONSchema. |
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 |
95affb3
to
08c8456
Compare
# @todo | ||
oneOf: | ||
- | ||
type: 'null' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure that it doesn't make sense to set optional parameters to null in yaml file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is null
.
https://github.com/Codeception/Codeception/blob/5.0/src/Codeception/Configuration.php#L116
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Null is the default value in the PHP code, it isn't necessary to set settings to null in yaml file and it can be forbidden.
A more usual approach to omit unnecessary settings.
Is there some command line tool for validation? It would be nice to have it in CI. |
Issue #6334 - Add JSONSchema definitions for configuration YAML files