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 parameter to disable additional properties #452

Merged

Conversation

p-spacek
Copy link
Contributor

@p-spacek p-spacek commented Apr 28, 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').

By default we can achieve same behave with setting each of schema object by property additionalProperties = false.
But this global disableAdditionalParameters set this globally for all object schemas.

For my purpose I'm using this to quickly switch between strict validation mode and not-strict.

What issues does this PR fix or reference?

no ref

Is it tested? How?

added tests

@coveralls
Copy link

coveralls commented Apr 28, 2021

Coverage Status

Coverage increased (+0.1%) to 79.731% when pulling 3f11204 on p-spacek:feat/disable-additional-properties into 813e2ce on redhat-developer:master.

@evidolob
Copy link
Collaborator

@p-spacek Could you provide PR for vscode-yaml with adding settings for disableAdditionalProperties ?

@p-spacek
Copy link
Contributor Author

p-spacek commented May 3, 2021

Created PR in vscode-yaml repo

  • just added this property into package contributes configuration.

@evidolob
Copy link
Collaborator

@p-spacek This PR has conflict, could you resolve it?

@evidolob evidolob merged commit 1be72ca into redhat-developer:master May 13, 2021
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

5 participants