-
Notifications
You must be signed in to change notification settings - Fork 64
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
Allow yaml-anchors in schema #2200
Conversation
@shreyas-goenka could you take a look? |
bundle/internal/schema/main.go
Outdated
// AdditionalProperties is set to an empty schema to allow non-typed keys used as yaml-anchors | ||
// Example: | ||
// some_anchor: &some_anchor | ||
// file_path: /some/path/ |
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.
Tab in comment.
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.
Replaced with spaces
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.
Can you make a corresponding passing test case?
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.
Good suggestion, added!
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.
Thank you!
Changes
Allows custom untyped fields in the root config in json-schema so it doesn't highlight errors when using yaml-anchors.
Example use case:
One downside is that we don't highlight any unknown top-level properties anymore (but they will still fail during CLI validation)
Tests
Manually checked behavior in VSCode - it doesn't show validation error. Also checked that other typed properties are still suggested