ActivityPub § 5.8 Shares Collection:
Every object MAY have a shares collection.… The shares collection MUST be either an OrderedCollection or a Collection
This is a Test describing a rule to determine whether an ActivityPub object has a shares property whose value conforms to a the requirement that "The shares collection MUST be either an OrderedCollection or a Collection".
The identifier of this test is urn:uuid:b03a5245-1072-426d-91b3-a3d412d45ae8.
The subject of this test is data claiming to conform to the specification of an ActivityPub Object.
This test is not inherently applicable to an ActivityPub Server. An ActivityPub Server serves 1 or more ActivityPub Objects.
This test is not inherently applicable to a URL that resolves to an ActivityPub Object. The URL is not the same as the Object. The URL may resolve to different Objects in different contexts. Dereference the URL to test the referent with this test.
This test requires the following inputs:
object - the object whose shares property will be tested
This test applies to the the shares property on the input object.
This test does not apply to objects with more than one shares collection. If the input object has a shares property whose value is an array length >= 2, the test outcome is inapplicable.
This test does not apply to objects for which a shares collection cannot be found.
If input object is not parseable as JSON to a JSON object, the test outcome is inapplicable.
If input object is a JSON object, but it does not contain a property named shares, the test outcome is inapplicable.
shares - the shares collection derived from the input object and its shares property
object that must be a JSON object, the value of this shares target will also be JSONshares from inputs
inputs.object be the JSON object parsed from input objectpropertyValue be
inputs.object.shares is a JSON string, propertyValue is that stringinputs.object.shares is a JSON object, propertyValue is that objectinputs.object.shares is an Array of length 1, propertyValue is the item in that arrayinputs.object.shares is an Array of length greater than 1, the test outcome is inapplicable (covered in 'Applicability' above)value be
*if outboxValue is a json string, value is the result of interpreting that string as an ActivityPub Object Identifier, fetching the corresponding ActivityPub Object (e.g. GET https://...), and parsing the resulting response body as application/json.
* otherwise value is outboxValueshares is equal to valueshares is a JSON objectshares has a property named typeshares target's type property must indicate that the value is either an OrderedCollection or a Collection as determined by:
shares target's type property is a string, it MUST be equal to either "OrderedCollection" or "Collection"shares target's type property is an Array, it MUST contain an entry for at least one of "OrderedCollection" or "Collection"This test chose to interpret 'MUST be… an' to include 'indicate its type as'. The rationale is:
inputs
object
{
shares: [{
type: ["Collection"]
}]
}
test targets
shares
{
"type": ["Collection"]
}
passedinputs
object
{
shares: 1
}
test targets
shares
1
failed
inputs
object
1
result
inapplicableoutcomeAn outcome is a conclusion that comes from evaluating a test on a test subject. An outcome can be one of the three following types:
inapplicable: No part of the test subject matches the applicabilitypassed: A test target meets all expectationsfailed: A test target does not meet all expectationsshares has outcome passed, requirement is satisfiedshares has outcome failed, requirement is not satisfiedshares has outcome inapplicable, further testing is needed to determine requirement satisfactionshares property whose value is an array of length >= 2