change nested structs to json annotation instead of json:api. It never made sense to use json:api annotation in nested structs

This commit is contained in:
Markus Ritberger 2017-08-14 20:41:26 +02:00
parent b391a84b75
commit fc6968dfe7
1 changed files with 7 additions and 7 deletions

View File

@ -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"`
}