Skip to content

feat: add config to disable additional properties#499

Merged
evidolob merged 3 commits intoredhat-developer:masterfrom
p-spacek:feat/disable-additional-properties
May 13, 2021
Merged

feat: add config to disable additional properties#499
evidolob merged 3 commits intoredhat-developer:masterfrom
p-spacek:feat/disable-additional-properties

Conversation

@p-spacek
Copy link
Copy Markdown
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
Copy Markdown
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

Comment thread 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
Copy Markdown
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
Copy Markdown
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.

4 participants