From 2675e843cf78f9822e67cc02fd3ee5e1eb827313 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);
}