I am building an Api application using ASP.NET Core. For validations, I started using FluentValidations instead of DataAnnotations. When it came to documenting my Api based on OpenSpecifications, I am using Swashbuckle.AspNetCore NuGet package.
But since Swashbuckle by default only works with DataAnnotations and not with FluentValidations, the schema is missing details such as if a field is required or not. SO pointed me to another NuGet package MicroElements.Swashbuckle.FluentValidation for integrating with FluentValidation.
I am now taking a step back and wondering if I am adding too many 3rd party package dependencies on my solution. Should I have just gone with DataAnnotations in the first place (flagging the approach taken as a trade-off)? I do love FluentValidations, especially the part where my rules are nicely separated into it's own class.
Question - At what point should one step back and look at these dependencies? Is there a rule of thumb to follow in these cases? In the environment in which I work, it's not so easy to bring in NuGet packages unless it goes through an approval cycle.
Any suggestions appreciated,
Thanks in advance,