-
Notifications
You must be signed in to change notification settings - Fork 263
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
fix: default value with special chars with anyOf #963
base: main
Are you sure you want to change the base?
fix: default value with special chars with anyOf #963
Conversation
let value = propertySchema.default || propertySchema.const; | ||
if (value) { | ||
if (type === 'string') { | ||
let value = propertySchema.default === undefined ? propertySchema.const : propertySchema.default; |
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.
fixes condition to allow null,0,emptyString as a default or const
the same logic is correctly used in other places
@@ -1242,10 +1242,6 @@ export class YamlCompletion { | |||
return this.getInsertTextForValue(value, separatorAfter, type); | |||
} | |||
|
|||
private getInsertTextForPlainText(text: string): string { |
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.
moved outside of the class to be able to use it from global functions
@p-spacek please rebase the repo |
8672460
to
2675e84
Compare
2675e84
to
26ec17a
Compare
What does this PR do?
This schema
doesn't escape default value
note that an object with anyOf (engine) needs to be inside another object (car), then getInserTextForObject is called with schema { car: {engine: anyOf}}
What issues does this PR fix or reference?
no ref
Is it tested? How?
unit-test