Converted the URL property to support an array of links as a value

This commit is contained in:
mariusor 2022-04-20 11:11:13 +02:00
parent 947bcada60
commit 4837641dc8
No known key found for this signature in database
GPG key ID: DBF5E47F5DBC4D21
15 changed files with 16 additions and 16 deletions

View file

@ -275,7 +275,7 @@ type Activity struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -1000,7 +1000,7 @@ func TestActivity_MarshalJSON(t *testing.T) {
Summary NaturalLanguageValues
Tag ItemCollection
Updated time.Time
URL LinkOrIRI
URL Item
To ItemCollection
Bto ItemCollection
CC ItemCollection
@ -1243,7 +1243,7 @@ func TestIntransitiveActivity_MarshalJSON(t *testing.T) {
Summary NaturalLanguageValues
Tag ItemCollection
Updated time.Time
URL LinkOrIRI
URL Item
To ItemCollection
Bto ItemCollection
CC ItemCollection

View file

@ -111,7 +111,7 @@ type Actor struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -101,7 +101,7 @@ type Collection struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -80,7 +80,7 @@ type CollectionPage struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -220,7 +220,7 @@ func writeObjectJSONValue(b *[]byte, o Object) (notEmpty bool) {
notEmpty = writeItemJSONProp(b, "tag", o.Tag) || notEmpty
}
if o.URL != nil {
notEmpty = writeIRIJSONProp(b, "url", o.URL) || notEmpty
notEmpty = writeItemJSONProp(b, "url", o.URL) || notEmpty
}
if o.To != nil {
notEmpty = writeItemJSONProp(b, "to", o.To) || notEmpty

View file

@ -84,7 +84,7 @@ type IntransitiveActivity struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -211,7 +211,7 @@ type Object struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -80,7 +80,7 @@ type OrderedCollection struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -81,7 +81,7 @@ type OrderedCollectionPage struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -79,7 +79,7 @@ type Place struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -81,7 +81,7 @@ type Profile struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -82,7 +82,7 @@ type Question struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -85,7 +85,7 @@ type Relationship struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.

View file

@ -81,7 +81,7 @@ type Tombstone struct {
// Updated the date and time at which the object was updated
Updated time.Time `jsonld:"updated,omitempty"`
// URL identifies one or more links to representations of the object
URL LinkOrIRI `jsonld:"url,omitempty"`
URL Item `jsonld:"url,omitempty"`
// To identifies an entity considered to be part of the public primary audience of an Activity Pub Object
To ItemCollection `jsonld:"to,omitempty"`
// Bto identifies anActivity Pub Object that is part of the private primary audience of this Activity Pub Object.