diff --git a/request.go b/request.go index fe29706..55a5da1 100644 --- a/request.go +++ b/request.go @@ -154,10 +154,6 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node) } if annotation == annotationPrimary { - if data.ID == "" { - continue - } - // Check the JSON API Type if data.Type != args[1] { er = fmt.Errorf( @@ -168,6 +164,10 @@ func unmarshalNode(data *Node, model reflect.Value, included *map[string]*Node) break } + if data.ID == "" { + continue + } + // ID will have to be transmitted as astring per the JSON API spec v := reflect.ValueOf(data.ID)