falkreon / Jankson

JSON5 / HJSON parser and preprocessor which preserves ordering and comments
MIT License
51 stars 9 forks source link

Add ability to skip uninitialized variables from being serialized #65

Open null2264 opened 2 years ago

null2264 commented 2 years ago

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
}
falkreon commented 2 years ago

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

Barteks2x commented 1 year ago

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