Skip to content

Commit

Permalink
Fix primitive type compatibility check in FieldSchemaNode
Browse files Browse the repository at this point in the history
  • Loading branch information
davelopez committed Jun 21, 2024
1 parent 8b1f543 commit 334b0b4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion server/gx-workflow-ls-format2/src/schema/definitions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { isCompatibleType, isWorkflowDataType } from "@gxwf/server-common/src/utils";

export interface SchemaDocument {
$base: string;
$namespaces?: object;
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit 334b0b4

Please sign in to comment.