For System.Text.Json these are your options, give them a try:
System.Text.Json
public class Person { [JsonInclude] public string Name; public string Role { get; set; } }