Mark strings as non-nullable in ASP.NET Core 3.0 Swagger
You can now use nullable reference types to mark strings as optional or required: Enable nullable reference types for your project/solution Mark strings in Dtos as nullable: public class ExampleDto { [StringLength(64, MinimumLength = 4)] public string RequiredString { get; set; } [StringLength(200)] public string? OptionalString { get; set; } } Enable Swagger support in … Read more