From fc6968dfe7f254d8285e5ba958f5f6d5514c7436 Mon Sep 17 00:00:00 2001 From: Markus Ritberger Date: Mon, 14 Aug 2017 20:41:26 +0200 Subject: [PATCH] change nested structs to json annotation instead of json:api. It never made sense to use json:api annotation in nested structs --- models_test.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/models_test.go b/models_test.go index d443378..eb38c98 100644 --- a/models_test.go +++ b/models_test.go @@ -165,14 +165,14 @@ type Company struct { } type Team struct { - Name string `jsonapi:"attr,name"` - Leader *Employee `jsonapi:"attr,leader"` - Members []Employee `jsonapi:"attr,members"` + Name string `json:"name"` + Leader *Employee `json:"leader"` + Members []Employee `json:"members"` } type Employee struct { - Firstname string `jsonapi:"attr,firstname"` - Surname string `jsonapi:"attr,surname"` - Age int `jsonapi:"attr,age"` - HiredAt *time.Time `jsonapi:"attr,hired-at,iso8601"` + Firstname string `json:"firstname"` + Surname string `json:"surname"` + Age int `json:"age"` + HiredAt *time.Time `json:"hired-at,iso8601"` }