From 024bf78f02740bf96c9cca327ebc3d03e74a5372 Mon Sep 17 00:00:00 2001 From: silverpill Date: Sat, 15 Feb 2025 19:55:10 +0000 Subject: [PATCH] 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 Co-committed-by: silverpill --- fep/2277/fep-2277.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fep/2277/fep-2277.md b/fep/2277/fep-2277.md index b25eccb..75a9a9a 100644 --- a/fep/2277/fep-2277.md +++ b/fep/2277/fep-2277.md @@ -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`.