When using .NETs required keyword, the properties that it is used on do not get marked as required in SwaggerGen. I set up a project to reproduce the issue. When adding the RequiredAttribute to the property, the result changes to the expected behavior.
I assume that this line could fix the problem if it checked for RequiredMemberAttribute too.
Thank you for investigating!
Version: 6.5.0
C# 11/.NET 7 and up
SwashbuckleReproduction.zip