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