1
0
mirror of https://codeberg.org/fediverse/fep.git synced 2026-08-05 11:46:04 +00:00

FEP-2277: Link should have higher priority (#496)

Algorithm is changed to always return `Link` when object has a `href` property.
This means actors and activities can't have this property.

Reviewed-on: https://codeberg.org/fediverse/fep/pulls/496
Co-authored-by: silverpill <silverpill@firemail.cc>
Co-committed-by: silverpill <silverpill@firemail.cc>
This commit is contained in:
silverpill
2025-02-15 19:55:10 +00:00
committed by silverpill
parent 107800132c
commit 024bf78f02
+2 -2
View File
@@ -44,10 +44,10 @@ Unfortunately, definitions provided in the specification are not precise. The la
One way to divide objects into distinct classes is to look at their properties and their connections to other objects (indicated by their properties). This approach can be used to define 5 core types:
- Object
- Link
- Actor
- Activity
- Collection
- Link
The next section specifies an algorithm that classifies any ActivityPub object as one of these core types by analyzing object's shape. This technique is often referred to as [duck typing][DuckTyping].
@@ -55,9 +55,9 @@ The next section specifies an algorithm that classifies any ActivityPub object a
The following algorithm can be used to determine the core type of the object:
1. If object has `href` property, return `Link`.
1. If object has `inbox` and `outbox` properties, return `Actor`.
1. If object has `actor` property, return `Activity`.
1. If object has `href` property, return `Link`.
1. If object has `items`, `orderedItems` or `totalItems` property, return `Collection`.
1. Otherwise, return `Object`.