It's not quite clear what is the problem. What garbage generation? What is usage (deserialization? serialization?) ? If you are not going to use data, then don't serialize it. As for your specific case, do it other way around: first deserialize json, then override what was deserialized with values you want to and then return.
↧