Optionally serialize a property based on its runtime value
问题 Fundamentally, I want to include or omit a property from the generated Json based on its value at the time of serialization. More-specifically, I have a type that knows if a value has been assigned to it and I only want to serialize properties of that type if there has been something assigned to it (so I need to inspect the value at runtime). I'm trying to make it easy for my API to detect the difference between "has the default value" and "wasn't specified at all". A custom JsonConverter