in src/Microsoft.Azure.WebJobs.Extensions.OpenApi.Core/Extensions/OpenApiSchemaExtensions.cs [393:446]
public static void ApplyValidationAttributes(this OpenApiSchema schema, IEnumerable<ValidationAttribute> customAttributes)
{
foreach (var attribute in customAttributes)
{
if (attribute is DataTypeAttribute dataTypeAttribute)
{
ApplyDataTypeAttribute(schema, dataTypeAttribute);
continue;
}
if (attribute is MinLengthAttribute minLengthAttribute)
{
ApplyMinLengthAttribute(schema, minLengthAttribute);
continue;
}
if (attribute is MaxLengthAttribute maxLengthAttribute)
{
ApplyMaxLengthAttribute(schema, maxLengthAttribute);
continue;
}
if (attribute is RangeAttribute rangeAttribute)
{
ApplyRangeAttribute(schema, rangeAttribute);
continue;
}
if (attribute is RegularExpressionAttribute regularExpressionAttribute)
{
ApplyRegularExpressionAttribute(schema, regularExpressionAttribute);
continue;
}
if (attribute is StringLengthAttribute stringLengthAttribute)
{
ApplyStringLengthAttribute(schema, stringLengthAttribute);
continue;
}
if (attribute is RequiredAttribute requiredAttribute)
{
ApplyRequiredAttribute(schema, requiredAttribute);
continue;
}
}
}