Does the new `System.Text.Json` have a required property attribute?
问题 I've combed through the MS docs but cannot find an attribute equivalent to the NewtonSoft JsonPropertyRequired. What I'm looking for this: public class Videogame { [JsonProperty(Required = Required.Always)] public string Name { get; set; } } Am I just missing something or does this level of validation not exist in the Microsoft library? 回答1: Not as of .NET core 3.0. The only ones supported are: JsonConverterAttribute JsonExtensionDataAttribute JsonIgnoreAttribute JsonPropertyNameAttribute