-
Notifications
You must be signed in to change notification settings - Fork 72
default to @JsonInclude(Include.NON_EMPTY) instead? #154
Comments
There was a reason... It may have had to do with the jsonschema2pojo plugin, couldn't override it possibly. Maybe. We should be able to override it on the object mapper though, might be easier that way. |
so far all my attempts at overriding it on the serializer have failed - I tried that first before raising this issue :( |
FWIW if I lose all ordering I can disable the empty rendering...
by disabling all annotations; but then I lose all those nice ordering annotations :( |
I've figured out a hacky way around the problem. Marshal to YAML, parse as a JsonNode, recursively remove all empty values, then marshal again (to then avoid seeing the NOT_NULL annotations). Hack!!! would love to delete this code one day! :) |
actually 2 entities which we want to keep the NON_NULL is for ConfigMap and Secret (or TBH any field called |
Why do you want them to be non-null & not non-empty? Empty maps seem a bit useless? |
Empty string data values in a ConfigMap get removed from the map with NON_Empty - which breaks a pod using valueFrom to map the entry to an env var |
Ah OK. So if you want to do this override |
I'm out next week so if you fancy doing it, go for it, otherwise easy enough to do when I'm back. |
when we generate YAML or JSON the output includes loads of empty values, lists, maps which looks kinda ugly.
Is there any reason we've gone with NON_NULL rather than the leaner NON_EMTPY?
The text was updated successfully, but these errors were encountered: