unless you overrode the default serializer, .net 6 webapi uses system.text.json, not newtonsoft. you need to use the system.text.json options
public class ClientFocus
{
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Item {get; set;}
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ItemTwo {get; set;}
}
Or you can config the default options at startup:
builder.Services
.AddControllers()
.AddJsonOptions(o =>
{
o.JsonSerializerOptions.DefaultIgnoreCondition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault;
});