From 26ec17a4f3f8621809ae8569e32fb6028f1c63b0 Mon Sep 17 00:00:00 2001 From: Petr Spacek Date: Thu, 2 May 2024 14:31:10 +0200 Subject: [PATCH] chore: accept null,0,emptyString in default or const property --- src/languageservice/services/yamlCompletion.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }