I have a class I need to serialize and it contains a lot of properties and fields, but I only need a small subset to be serialized, not the entire class. I also want to guarantee that I won't inadvertently add fields in the future which would be serialized and break my expectation of what gets serialized by suddenly including something new.
So is there any annotation I can use to basically specify what gets serialize only?
I'd need like the opposite of @JsonIgnoreProperties. Something that acts as a whitelist instead of a blacklist.