Jankson icon indicating copy to clipboard operation
Jankson copied to clipboard

Add ability to skip uninitialized variables from being serialized

Open null2264 opened this issue 3 years ago • 2 comments

Currently, uninitialized variables are being serialized as null:

{
  "id": "minecraft:cobblestone",
  "weight": 60,
  "dimensions": null
}

But it'd be great if I skip it and generate a much cleaner JSON file:

{
  "id": "minecraft:cobblestone",
  "weight": 60
}

null2264 avatar Sep 06 '22 13:09 null2264

May be worth it to tag this for the 1.2.x branch so this can be available before the Document update.

falkreon avatar Sep 06 '22 13:09 falkreon

I would like at least an option to actually serialize them as null, as I want all the values in my json to be provided explicitly

Niko-sk2x avatar Dec 30 '22 00:12 Niko-sk2x