Hey, i would like to ask the support for media types, because I am uploading an image and the documentation doesnt follow the fluentvalidation rules. Check it below:
internal static class UploadProductImageConsts
{
public const long MaxSizeBytes = 2 * 1024 * 1024;
public static readonly string[] AllowedContentTypes = ["image/jpeg", "image/png"];
}
internal sealed class UploadProductImageRequestValidator : AbstractValidator<UploadProductImageRequest>
{
public UploadProductImageRequestValidator()
{
RuleFor(x => x.File)
.NotNull();
RuleFor(x => x.File.Length)
.GreaterThan(0)
.LessThanOrEqualTo(UploadProductImageConsts.MaxSizeBytes)
.When(x => x.File is not null);
RuleFor(x => x.File.ContentType)
.Must(UploadProductImageConsts.AllowedContentTypes.Contains)
.When(x => x.File is not null);
}
}

Hey, i would like to ask the support for media types, because I am uploading an image and the documentation doesnt follow the fluentvalidation rules. Check it below: