From e5c28b65b5d3ef2e5c98c71f55faa7c60d7864f0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 21 Aug 2021 21:43:03 +0300 Subject: ActivityPub: do not duplicate type property --- src/main/java/com/juick/www/api/activity/model/Context.java | 2 +- .../java/com/juick/www/api/activity/model/objects/Application.java | 4 ---- src/main/java/com/juick/www/api/activity/model/objects/Person.java | 5 ----- 3 files changed, 1 insertion(+), 10 deletions(-) (limited to 'src/main/java/com/juick/www/api/activity/model') diff --git a/src/main/java/com/juick/www/api/activity/model/Context.java b/src/main/java/com/juick/www/api/activity/model/Context.java index fb726565..d7b23539 100644 --- a/src/main/java/com/juick/www/api/activity/model/Context.java +++ b/src/main/java/com/juick/www/api/activity/model/Context.java @@ -30,7 +30,7 @@ import java.util.List; import java.util.Map; @JsonIgnoreProperties(ignoreUnknown = true) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property="type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property="type") @JsonSubTypes({ @JsonSubTypes.Type(value = Create.class, name = "Create"), @JsonSubTypes.Type(value = Update.class, name = "Update"), diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Application.java b/src/main/java/com/juick/www/api/activity/model/objects/Application.java index 23a44e49..29361b33 100644 --- a/src/main/java/com/juick/www/api/activity/model/objects/Application.java +++ b/src/main/java/com/juick/www/api/activity/model/objects/Application.java @@ -18,8 +18,4 @@ package com.juick.www.api.activity.model.objects; public class Application extends SecurityObject { - @Override - public String getType() { - return "Application"; - } } diff --git a/src/main/java/com/juick/www/api/activity/model/objects/Person.java b/src/main/java/com/juick/www/api/activity/model/objects/Person.java index 52626833..84844510 100644 --- a/src/main/java/com/juick/www/api/activity/model/objects/Person.java +++ b/src/main/java/com/juick/www/api/activity/model/objects/Person.java @@ -29,11 +29,6 @@ public class Person extends SecurityObject { private String following; private String followers; - @Override - public String getType() { - return "Person"; - } - public String getName() { return name; } -- cgit v1.2.3