Changes
5 changed files (+18/-23)
-
-
@@ -251,11 +251,10 @@ func (c Collection) MarshalJSON() ([]byte, error) {if c.Last != nil { notEmpty = writeItemProp(&b, "last", c.Last) || notEmpty } notEmpty = writeIntProp(&b, "totalItems", int64(c.TotalItems)) || notEmpty if c.Items != nil { notEmpty = writeItemCollectionProp(&b, "items", c.Items) || notEmpty } notEmpty = writeIntProp(&b, "totalItems", int64(c.TotalItems)) || notEmpty if notEmpty { write(&b, '}') return b, nil
-
-
-
@@ -197,6 +197,9 @@ func (c CollectionPage) MarshalJSON() ([]byte, error) {notEmpty = writeObjectValue(&b, *o) return nil }) if c.PartOf != nil { notEmpty = writeItemProp(&b, "partOf", c.PartOf) || notEmpty } if c.Current != nil { notEmpty = writeItemProp(&b, "current", c.Current) || notEmpty }
-
@@ -206,21 +209,16 @@ func (c CollectionPage) MarshalJSON() ([]byte, error) {if c.Last != nil { notEmpty = writeItemProp(&b, "last", c.Last) || notEmpty } if c.Items != nil { notEmpty = writeItemCollectionProp(&b, "items", c.Items) || notEmpty } if c.PartOf != nil { notEmpty = writeItemProp(&b, "partOf", c.PartOf) || notEmpty } if c.Next != nil { notEmpty = writeItemProp(&b, "next", c.Next) || notEmpty } if c.Prev != nil { notEmpty = writeItemProp(&b, "prev", c.Prev) || notEmpty } notEmpty = writeIntProp(&b, "totalItems", int64(c.TotalItems)) || notEmpty if c.Items != nil { notEmpty = writeItemCollectionProp(&b, "items", c.Items) || notEmpty } if notEmpty { write(&b, '}') return b, nil
-
-
-
@@ -573,11 +573,11 @@ func loadCollection(data []byte, c *Collection) error {OnObject(c, func(o *Object) error { return loadObject(data, o) }) c.Items = JSONGetItems(data, "items") c.TotalItems = uint(JSONGetInt(data, "totalItems")) c.Current = JSONGetItem(data, "current") c.First = JSONGetItem(data, "first") c.Last = JSONGetItem(data, "last") c.TotalItems = uint(JSONGetInt(data, "totalItems")) c.Items = JSONGetItems(data, "items") return nil }
-
@@ -595,11 +595,11 @@ func loadOrderedCollection(data []byte, c *OrderedCollection) error {OnObject(c, func(o *Object) error { return loadObject(data, o) }) c.OrderedItems = JSONGetItems(data, "orderedItems") c.TotalItems = uint(JSONGetInt(data, "totalItems")) c.Current = JSONGetItem(data, "current") c.First = JSONGetItem(data, "first") c.Last = JSONGetItem(data, "last") c.TotalItems = uint(JSONGetInt(data, "totalItems")) c.OrderedItems = JSONGetItems(data, "orderedItems") return nil }
-
-
-
@@ -247,11 +247,10 @@ func (o OrderedCollection) MarshalJSON() ([]byte, error) {if o.Last != nil { notEmpty = writeItemProp(&b, "last", o.Last) || notEmpty } notEmpty = writeIntProp(&b, "totalItems", int64(o.TotalItems)) || notEmpty if o.OrderedItems != nil { notEmpty = writeItemCollectionProp(&b, "orderedItems", o.OrderedItems) || notEmpty } notEmpty = writeIntProp(&b, "totalItems", int64(o.TotalItems)) || notEmpty if notEmpty { write(&b, '}') return b, nil
-
-
-
@@ -200,6 +200,9 @@ func (o OrderedCollectionPage) MarshalJSON() ([]byte, error) {notEmpty = writeObjectValue(&b, *o) return nil }) if o.PartOf != nil { notEmpty = writeItemProp(&b, "partOf", o.PartOf) || notEmpty } if o.Current != nil { notEmpty = writeItemProp(&b, "current", o.Current) || notEmpty }
-
@@ -209,12 +212,6 @@ func (o OrderedCollectionPage) MarshalJSON() ([]byte, error) {if o.Last != nil { notEmpty = writeItemProp(&b, "last", o.Last) || notEmpty } if o.OrderedItems != nil { notEmpty = writeItemCollectionProp(&b, "orderedItems", o.OrderedItems) || notEmpty } if o.PartOf != nil { notEmpty = writeItemProp(&b, "partOf", o.PartOf) || notEmpty } if o.Next != nil { notEmpty = writeItemProp(&b, "next", o.Next) || notEmpty }
-
@@ -222,7 +219,9 @@ func (o OrderedCollectionPage) MarshalJSON() ([]byte, error) {notEmpty = writeItemProp(&b, "prev", o.Prev) || notEmpty } notEmpty = writeIntProp(&b, "totalItems", int64(o.TotalItems)) || notEmpty if o.OrderedItems != nil { notEmpty = writeItemCollectionProp(&b, "orderedItems", o.OrderedItems) || notEmpty } if notEmpty { write(&b, '}') return b, nil
-