-
Notifications
You must be signed in to change notification settings - Fork 233
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
feat: add config to disable additional properties #499
feat: add config to disable additional properties #499
Conversation
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.
Approving, but it looks like there's now a conflict after some PR's have been merged. @p-spacek can you take a look? and then we can merge it
package.json
Outdated
"yaml.disableAdditionalProperties": { | ||
"type": "boolean", | ||
"default": false, | ||
"description": "Globally set additionalProperties to false to all objects. So if its true, no extra properties are allowed inside yaml." |
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.
Should "to false to all objects" be "to false for all objects"?
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.
Sure, make sense
* redhat-developer#371 Support relative path in inline schema comment Signed-off-by: Yevhen Vydolob <[email protected]> * Fix test on windows
What does this PR do?
Add
disableAdditionalProperties
into yaml configuration and if is set to true yaml validation won’t allow extra props that are not in schema (where type == 'object').What issues does this PR fix or reference?
redhat-developer/yaml-language-server#452 (comment)
Is it tested? How?
If is
disableAdditionalProperties
set totrue
, you can't put any extra object props into yaml.