From 334b0b42fe8ce09e8a1991f5e0a47365e134d0fc Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:58:53 +0200 Subject: [PATCH] Fix primitive type compatibility check in FieldSchemaNode --- server/gx-workflow-ls-format2/src/schema/definitions.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/gx-workflow-ls-format2/src/schema/definitions.ts b/server/gx-workflow-ls-format2/src/schema/definitions.ts index 14b87df..0568f86 100644 --- a/server/gx-workflow-ls-format2/src/schema/definitions.ts +++ b/server/gx-workflow-ls-format2/src/schema/definitions.ts @@ -1,3 +1,5 @@ +import { isCompatibleType, isWorkflowDataType } from "@gxwf/server-common/src/utils"; + export interface SchemaDocument { $base: string; $namespaces?: object; @@ -266,7 +268,10 @@ export class FieldSchemaNode implements SchemaNode, IdMapper { if (this.canBeAny) return true; if (typeName === "null" && this.isOptional) return true; for (const allowedType of this._allowedTypes) { - if (allowedType.typeName === typeName) { + if ( + allowedType.typeName === typeName || + (isWorkflowDataType(allowedType.typeName) && isCompatibleType(allowedType.typeName, typeName)) + ) { return true; } if (isArrayFieldType(allowedType)) {