Skip to content

Commit fc6968d

Browse files
committed
change nested structs to json annotation instead of json:api. It never made sense to use json:api annotation in nested structs
1 parent b391a84 commit fc6968d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

models_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,14 +165,14 @@ type Company struct {
165165
}
166166

167167
type Team struct {
168-
Name string `jsonapi:"attr,name"`
169-
Leader *Employee `jsonapi:"attr,leader"`
170-
Members []Employee `jsonapi:"attr,members"`
168+
Name string `json:"name"`
169+
Leader *Employee `json:"leader"`
170+
Members []Employee `json:"members"`
171171
}
172172

173173
type Employee struct {
174-
Firstname string `jsonapi:"attr,firstname"`
175-
Surname string `jsonapi:"attr,surname"`
176-
Age int `jsonapi:"attr,age"`
177-
HiredAt *time.Time `jsonapi:"attr,hired-at,iso8601"`
174+
Firstname string `json:"firstname"`
175+
Surname string `json:"surname"`
176+
Age int `json:"age"`
177+
HiredAt *time.Time `json:"hired-at,iso8601"`
178178
}

0 commit comments

Comments
 (0)