Skip to content

Commit

Permalink
Hotfix package builder emitting JSON with missing keys for empty values
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hedgehog1029 committed May 1, 2022
1 parent 2fe96e4 commit debd822
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public static void main(String[] args) throws IOException, InterruptedException
// 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);
Expand Down

0 comments on commit debd822

Please sign in to comment.