Closed dxxvi closed 1 month ago
This is the only micronaut-related library I use:
<dependency> <groupId>io.micronaut.serde</groupId> <artifactId>micronaut-serde-jackson</artifactId> <version>2.10.2</version> </dependency>
Could somebody write me some code to serialize an instance of this class?
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import io.micronaut.serde.annotation.Serdeable; @Serdeable public class GameScore { @JsonProperty(value = "game_id", required = true) private final String gameId; // playerId is in the message key @JsonProperty(value = "score", required = true) private final int score; @JsonCreator public GameScore(String gameId, int score) { this.gameId = gameId; this.score = score; } public String getGameId() { return gameId; } public int getScore() { return score; } }
maven or Gradle?
Issue description
This is the only micronaut-related library I use:
Could somebody write me some code to serialize an instance of this class?