From 8c5b4bd0126a3ad939118ba59f98397622c19f50 Mon Sep 17 00:00:00 2001 From: Netra Mali Date: Mon, 3 Feb 2025 15:39:41 -0500 Subject: [PATCH] add back the original check --- request.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/request.go b/request.go index 9864e78..0cf4c1c 100644 --- a/request.go +++ b/request.go @@ -517,7 +517,7 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node) if relationship.Data == nil { // Explicit null supplied for the field value // If a nullable relationship we set the field value to a map with a single entry - if isExplicitNull { + if isExplicitNull && strings.HasPrefix(fieldType.Type.Name(), "NullableRelationship[") { fieldValue.Set(reflect.MakeMapWithSize(fieldValue.Type(), 1)) fieldValue.SetMapIndex(reflect.ValueOf(false), m) } @@ -531,7 +531,6 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node) continue } - err = unmarshalNodeMaybeChoice(&m, relationship.Data, annotation, choiceMapping, included) if err != nil { er = err