When building a web API with ASP.NET in most cases I want to generate Swagger (a.k.a. OpenAPI, what a boring name). Since records became a thing in C# I almost exclusively use positional records for my DTOs. I just assumed that
Swashbuckle handles everything perfectly. It was pointed out to me that our Swagger does not mark non-nullable properties as required and I then realized that in Swagger just like in JS non-nullable and required were not the same thing. I started digging and I found out that the OpenAPI specs allows for much more information around validation like a regex pattern, min and max value and a couple more that are rarer. So why are these not generated for my project?