Validations in C# Codes - zijianhuang/openapiclientgen GitHub Wiki
Validations in C# for POCO classes are generally done through declarative attributes decorating each property. OpenApiClientGen can generate client API C# codes with respective attributes according to data constraints in OpenAPI definitions.
Mappings
Validations
Constraints | Attributes |
---|---|
required | Required |
minLength | MinLength |
maxLength | MaxLength |
minimum | Range |
maximum | Range |
pattern | RegularExpression |
date | DateType(DataAnnotations.DataType.Date) if DateToDateOnly is false |