-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
Please Describe The Problematic Behavior
I have this code:
followers := streams.NewActivityStreamsOrderedCollection()
id := streams.NewJSONLDIdProperty()
id.SetIRI(u.FollowersIRI())
items := streams.NewActivityStreamsOrderedItemsProperty()
for _, follower := range u.Followers {
log.Println("appending follower", follower.ID)
iri, err := url.Parse(follower.ID)
if err != nil {
log.Println("error parsing url for followers list:", err.Error())
continue
}
items.PrependIRI(iri)
}
followers.SetActivityStreamsOrderedItems(items)When I hit the followers endpoint of my app, this is the response
{
"@context": "https://www.w3.org/ns/activitystreams",
"orderedItems": "http://localhost:8080/user/test",
"type": "OrderedCollection"
}I added two calls to PrependIRI() and the response was an array:
{
"@context": "https://www.w3.org/ns/activitystreams",
"orderedItems": [
"http://localhost:8080/user/test",
"http://localhost:8080/user/test"
],
"type": "OrderedCollection"
}Please Describe The Expected Behavior
When there is only one item in the ordered items it still renders as an array.
Metadata
Metadata
Assignees
Labels
No labels