Unify API route parameters, return IResult everywhere, merge picture upload DTOs and centralize validation limits
Guid and long route constraints, id/trackId parameter names, Update*Request without the New prefix, sentence-case operation summaries, shared security scheme id and a single Limits class.
This commit is contained in:
@@ -7,15 +7,15 @@ public sealed class UpdateAlbumRequestValidator : AbstractValidator<UpdateAlbumR
|
||||
{
|
||||
public UpdateAlbumRequestValidator()
|
||||
{
|
||||
RuleFor(x => x.NewTitle)
|
||||
RuleFor(x => x.Title)
|
||||
.NotEmpty()
|
||||
.MaximumLength(200);
|
||||
.MaximumLength(Limits.AlbumTitle);
|
||||
|
||||
RuleFor(x => x.NewDescription)
|
||||
.MaximumLength(256);
|
||||
RuleFor(x => x.Description)
|
||||
.MaximumLength(Limits.Description);
|
||||
|
||||
RuleFor(x => x.NewReleaseYear)
|
||||
.InclusiveBetween(AlbumReleaseYear.Earliest, AlbumReleaseYear.Latest)
|
||||
.When(x => x.NewReleaseYear.HasValue);
|
||||
RuleFor(x => x.ReleaseYear)
|
||||
.InclusiveBetween(Limits.EarliestReleaseYear, Limits.LatestReleaseYear)
|
||||
.When(x => x.ReleaseYear.HasValue);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user