diff --git a/src/languageservice/services/yamlCompletion.ts b/src/languageservice/services/yamlCompletion.ts index 25188cbe..9b4542cb 100644 --- a/src/languageservice/services/yamlCompletion.ts +++ b/src/languageservice/services/yamlCompletion.ts @@ -1114,8 +1114,8 @@ export class YamlCompletion { case 'number': case 'integer': case 'anyOf': { - let value = propertySchema.default || propertySchema.const; - if (value) { + let value = propertySchema.default === undefined ? propertySchema.const : propertySchema.default; + if (isDefined(value)) { if (type === 'string' || typeof value === 'string') { value = convertToStringValue(value); }