forked from Mirrors/jsonapi
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:
parent
b391a84b75
commit
fc6968dfe7
|
@ -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"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue