Skip to content

Commit 2675e84

Browse files
committed
chore: accept null,0,emptyString in default or const property
1 parent 91ee153 commit 2675e84

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/languageservice/services/yamlCompletion.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1114,8 +1114,8 @@ export class YamlCompletion {
11141114
case 'number':
11151115
case 'integer':
11161116
case 'anyOf': {
1117-
let value = propertySchema.default || propertySchema.const;
1118-
if (value) {
1117+
let value = propertySchema.default === undefined ? propertySchema.const : propertySchema.default;
1118+
if (isDefined(value)) {
11191119
if (type === 'string' || typeof value === 'string') {
11201120
value = convertToStringValue(value);
11211121
}

0 commit comments

Comments
 (0)