From 27c3d6554a23e8520909996891c2d8ba6bbef4b2 Mon Sep 17 00:00:00 2001 From: Yannik Bretschneider Date: Sun, 30 May 2021 17:01:48 +0200 Subject: [PATCH] fix: fixed JSON mapping of requestTypes --- .../teamname/marvelous/gamelibrary/requests/Request.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java index ace94f9..70c88ed 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/requests/Request.java @@ -1,6 +1,10 @@ package uulm.teamname.marvelous.gamelibrary.requests; +import com.fasterxml.jackson.annotation.JsonAlias; +import com.fasterxml.jackson.annotation.JsonKey; +import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import uulm.teamname.marvelous.gamelibrary.json.basic.EventMessage; import uulm.teamname.marvelous.gamelibrary.json.ingame.RequestDeserializer; @@ -9,7 +13,8 @@ import java.util.Objects; /** Represents an abstract request sent inside a {@link EventMessage} between client and server. */ @JsonDeserialize(using = RequestDeserializer.class) public abstract class Request { - public RequestType type; + + @JsonProperty("requestType") public RequestType type; @Override