Skip to content

Commit 9771a4d

Browse files
committed
Read the reaction type Core sends
Core returns a person's reactions with the field `type`, but Reaction declared `reaction_type` (alias reactionType), so it was always None. The field is now `type`; `reaction_type` stays as a read-only property so code written against 1.4.9 and earlier keeps working.
1 parent af22eff commit 9771a4d

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎linkedapi/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
verify_webhook_signature,
9191
)
9292

93-
__version__ = "1.4.9"
93+
__version__ = "1.4.10"
9494
PredefinedOperation = Operation
9595

9696
__all__ = [

‎linkedapi/types/post.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ class ContentViewerState(LinkedApiModel):
3030
class Reaction(LinkedApiModel):
3131
post_url: str | None = None
3232
time: str | None = None
33-
reaction_type: ReactionType | str | None = None
33+
type: ReactionType | str | None = None
34+
35+
@property
36+
def reaction_type(self) -> ReactionType | str | None:
37+
"""Former name of ``type``, kept so code written against 1.4.9 and earlier keeps working."""
38+
return self.type
3439

3540

3641
class Comment(LinkedApiModel):

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "linkedapi"
7-
version = "1.4.9"
7+
version = "1.4.10"
88
description = "Official synchronous Python SDK for Linked API."
99
readme = "README.md"
1010
requires-python = ">=3.10"

‎tests/test_open_vocabularies.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
("PostReposter", "type", "person"),
5555
("ProfileViewer", "viewer_type", "identified"),
5656
("ProfileViewer", "connection_degree", 1),
57-
("Reaction", "reaction_type", "like"),
57+
("Reaction", "type", "like"),
5858
("SearchPostActor", "type", "person"),
5959
("SearchPostResult", "type", "original"),
6060
("SetSeatsResult", "status", "complete"),

0 commit comments

Comments
 (0)