Skip to content
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

Merged

Conversation

p-spacek
Copy link
Contributor

@p-spacek p-spacek commented May 3, 2021

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 to true, you can't put any extra object props into yaml.

Copy link
Contributor

@JPinkney JPinkney left a 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."
Copy link
Member

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"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, make sense

@evidolob evidolob merged commit 4cf82de into redhat-developer:master May 13, 2021
bleach31 pushed a commit to bleach31/vscode-yaml that referenced this pull request Jan 25, 2022
* redhat-developer#371 Support relative path in inline schema comment

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>

* Fix test on windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants