Added icon and image properties to object unmarshalling
This commit is contained in:
parent
a955ef13ec
commit
d1e2ae9598
2 changed files with 8 additions and 0 deletions
|
@ -541,6 +541,8 @@ func (o *Object) UnmarshalJSON(data []byte) error {
|
|||
o.InReplyTo = getAPItem(data, "inReplyTo")
|
||||
o.Published = getAPTime(data, "published")
|
||||
o.StartTime = getAPTime(data, "startTime")
|
||||
o.Icon = getAPItem(data, "icon")
|
||||
o.Image = getAPItem(data, "image")
|
||||
o.Updated = getAPTime(data, "updated")
|
||||
to := getAPItems(data, "to")
|
||||
if to != nil {
|
||||
|
|
|
@ -330,6 +330,12 @@ func validateEmptyObject(o Object, t *testing.T) {
|
|||
if o.URL != nil {
|
||||
t.Errorf("Unmarshalled object %T should have empty URL, received %v", o, o.URL)
|
||||
}
|
||||
if o.Icon != nil {
|
||||
t.Errorf("Unmarshalled object %T should have empty Icon, received %v", o, o.Icon)
|
||||
}
|
||||
if o.Image != nil {
|
||||
t.Errorf("Unmarshalled object %T should have empty Image, received %v", o, o.Image)
|
||||
}
|
||||
if !o.Published.IsZero() {
|
||||
t.Errorf("Unmarshalled object %T should have empty Published, received %q", o, o.Published)
|
||||
}
|
||||
|
|
Reference in a new issue