Skip to content

Commit

Permalink
addressed comments
Browse files Browse the repository at this point in the history
  • Loading branch information
netramali committed Jan 24, 2025
1 parent ccc60b3 commit f63a032
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node)
// this indicates disassociating the relationship
isExplicitNull = true
} else if relationshipDecodeErr != nil {
fmt.Printf("decode err %v\n", relationshipDecodeErr)
er = fmt.Errorf("decode err %v\n", relationshipDecodeErr)
}

// This will hold either the value of the choice type model or the actual
Expand All @@ -517,11 +517,11 @@ 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
if isExplicitNull && strings.HasPrefix(fieldType.Type.Name(), "NullableRelationship[") {
fieldValue.Set(reflect.MakeMapWithSize(fieldValue.Type(), 1))
fieldValue.SetMapIndex(reflect.ValueOf(false), m)
}
// If a nullable relationship we set the field value to a map with a single entry
if isExplicitNull {
fieldValue.Set(reflect.MakeMapWithSize(fieldValue.Type(), 1))
fieldValue.SetMapIndex(reflect.ValueOf(false), m)
}

continue
}
Expand Down

0 comments on commit f63a032

Please sign in to comment.