Skip to content

Commit f63a032

Browse files
committed
addressed comments
1 parent ccc60b3 commit f63a032

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

request.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
493493
// this indicates disassociating the relationship
494494
isExplicitNull = true
495495
} else if relationshipDecodeErr != nil {
496-
fmt.Printf("decode err %v\n", relationshipDecodeErr)
496+
er = fmt.Errorf("decode err %v\n", relationshipDecodeErr)
497497
}
498498

499499
// This will hold either the value of the choice type model or the actual
@@ -517,11 +517,11 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
517517
if relationship.Data == nil {
518518

519519
// Explicit null supplied for the field value
520-
// If a nullable relationship we set the
521-
if isExplicitNull && strings.HasPrefix(fieldType.Type.Name(), "NullableRelationship[") {
522-
fieldValue.Set(reflect.MakeMapWithSize(fieldValue.Type(), 1))
523-
fieldValue.SetMapIndex(reflect.ValueOf(false), m)
524-
}
520+
// If a nullable relationship we set the field value to a map with a single entry
521+
if isExplicitNull {
522+
fieldValue.Set(reflect.MakeMapWithSize(fieldValue.Type(), 1))
523+
fieldValue.SetMapIndex(reflect.ValueOf(false), m)
524+
}
525525

526526
continue
527527
}

0 commit comments

Comments
 (0)