1
0
mirror of https://github.com/SKCraft/Launcher.git synced 2024-11-27 12:46:22 +01:00

Hotfix package builder emitting JSON with missing keys for empty values

The meaning of `mapper.setSerializationInclusion` changed with the
Jackson upgrade, which meant that empty collections were being fully
stripped from the output. Fix by changing the strategy to NON_ABSENT,
which only strips nulls and "absent" values like Optional.absent
This commit is contained in:
Henry Le Grys 2022-05-01 15:34:48 +01:00
parent 2fe96e4435
commit debd822447

View File

@ -407,7 +407,7 @@ public class PackageBuilder {
// Initialize
SimpleLogFormatter.configureGlobalLogger();
ObjectMapper mapper = new ObjectMapper();
mapper.setSerializationInclusion(JsonInclude.Include.NON_DEFAULT);
mapper.setSerializationInclusion(JsonInclude.Include.NON_ABSENT);
Manifest manifest = new Manifest();
manifest.setMinimumVersion(Manifest.MIN_PROTOCOL_VERSION);