diff --git a/swh/model/model.py b/swh/model/model.py
index 39331793e782cd8f401b6912fa4952539cdd0c04..ee1be6897b8ee0dcf7a71cc5086845678ae3a55a 100644
--- a/swh/model/model.py
+++ b/swh/model/model.py
@@ -121,6 +121,8 @@ class HashableObject(metaclass=ABCMeta):
 
     __slots__ = ()
 
+    id: Sha1Git
+
     @abstractmethod
     def compute_hash(self) -> bytes:
         """Derived model classes must implement this to compute
@@ -137,7 +139,7 @@ class HashableObject(metaclass=ABCMeta):
             object.__setattr__(self, "id", obj_id)
 
     def unique_key(self) -> KeyType:
-        return self.id  # type: ignore
+        return self.id
 
 
 @attr.s(frozen=True, slots=True)