Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit 2940c97

Browse files
author
Carl Markham
committed
omitempty relationship data attribute
1 parent f822737 commit 2940c97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

node.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ type Node struct {
4646

4747
// RelationshipOneNode is used to represent a generic has one JSON API relation
4848
type RelationshipOneNode struct {
49-
Data *Node `json:"data"`
49+
Data *Node `json:"data,omitempty"`
5050
Links *Links `json:"links,omitempty"`
5151
Meta *Meta `json:"meta,omitempty"`
5252
}
5353

5454
// RelationshipManyNode is used to represent a generic has many JSON API
5555
// relation
5656
type RelationshipManyNode struct {
57-
Data []*Node `json:"data"`
57+
Data []*Node `json:"data,omitempty"`
5858
Links *Links `json:"links,omitempty"`
5959
Meta *Meta `json:"meta,omitempty"`
6060
}

0 commit comments

Comments
 (0)