How to skip empty string properties when serializing with System.Text.Json
System.Text.Json has no WhenWritingEmpty option, WhenWritingDefault still writes "", and a JsonConverter<string> that writes nothing produces invalid JSON. The fix is a type-info resolver modifier that sets JsonPropertyInfo.ShouldSerialize, for reflection and source-generated contexts, checked on .NET 10.0.10 and .NET 11 RC3.