I'm using the latest beta version on .NET 7 latest with the latest stable FV. I have the following record and validation rule and I noticed that my swagger doesn't include any of the not empty or length data (I was expecting these to be populated along side the nullable flag to control if they are optional):
public record MyModel(string? InviteToken = null);
public class MyModelValidator : AbstractValidator<MyModel>
{
public MyModelValidator ()
{
RuleFor(u => u.InviteToken).NotEmpty().Length(40).When(m => m.InviteToken is not null);
}
}
Looking at the generated swagger.json
"MyModel": {
"required": [
],
"type": "object",
"properties": {
"invite_token": {
"type": "string",
"nullable": true
}
},
"additionalProperties": false
},
I'm using the latest beta version on .NET 7 latest with the latest stable FV. I have the following record and validation rule and I noticed that my swagger doesn't include any of the not empty or length data (I was expecting these to be populated along side the nullable flag to control if they are optional):
Looking at the generated swagger.json