Change default Jackson behaviour to not serialize nulls
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m23s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 1m23s
This commit is contained in:
parent
d2a54ac828
commit
592bca234b
@ -23,7 +23,6 @@
|
||||
*/
|
||||
package me.braydon.mc.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.*;
|
||||
import me.braydon.mc.common.ColorUtils;
|
||||
import me.braydon.mc.service.pinger.MinecraftServerPinger;
|
||||
@ -68,7 +67,7 @@ public class MinecraftServer {
|
||||
/**
|
||||
* Player count data for a server.
|
||||
*/
|
||||
@AllArgsConstructor @Getter @ToString @JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@AllArgsConstructor @Getter @ToString
|
||||
public static class Players {
|
||||
/**
|
||||
* The online players on this server.
|
||||
|
@ -23,7 +23,6 @@
|
||||
*/
|
||||
package me.braydon.mc.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import lombok.*;
|
||||
import org.springframework.data.annotation.Id;
|
||||
|
||||
@ -36,7 +35,7 @@ import java.util.UUID;
|
||||
*/
|
||||
@AllArgsConstructor @Getter
|
||||
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
|
||||
@ToString @JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@ToString
|
||||
public class Player {
|
||||
/**
|
||||
* The unique id of this player.
|
||||
|
@ -23,7 +23,6 @@
|
||||
*/
|
||||
package me.braydon.mc.model.server;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import lombok.*;
|
||||
import me.braydon.mc.common.JavaMinecraftVersion;
|
||||
@ -39,7 +38,7 @@ import net.md_5.bungee.chat.ComponentSerializer;
|
||||
*
|
||||
* @author Braydon
|
||||
*/
|
||||
@Setter @Getter @ToString(callSuper = true) @JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Setter @Getter @ToString(callSuper = true)
|
||||
public final class JavaMinecraftServer extends MinecraftServer {
|
||||
/**
|
||||
* The version information of this server.
|
||||
@ -115,7 +114,7 @@ public final class JavaMinecraftServer extends MinecraftServer {
|
||||
/**
|
||||
* Version information for a server.
|
||||
*/
|
||||
@AllArgsConstructor @Getter @ToString @JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@AllArgsConstructor @Getter @ToString
|
||||
public static class Version {
|
||||
/**
|
||||
* The version name of the server.
|
||||
|
@ -21,6 +21,10 @@ spring:
|
||||
database: 0
|
||||
auth: "" # Leave blank for no auth
|
||||
|
||||
# Don't serialize null values by default with Jackson
|
||||
jackson:
|
||||
default-property-inclusion: non_null
|
||||
|
||||
# Ignore
|
||||
banner:
|
||||
location: "classpath:banner.txt"
|
Loading…
Reference in New Issue
Block a user