fairybread icon indicating copy to clipboard operation
fairybread copied to clipboard

Expose validation rules via schema / field

Open benmccallum opened this issue 4 years ago • 1 comments

Goals:

  1. Expose FluentValidation rules via schema
  2. Accessibility - support pulling validation copy from resource files globalization (i18n)

Stretch goals:

  1. Support/execute + expose DataAnnotation attributes

benmccallum avatar Feb 20 '21 16:02 benmccallum

  1. Needs investigation as we need to see if / how FluentValidation rules turn into metadata in the MVC integration and how we could repurpose that out of the schema. @jmercha suggested we could use / take inspiration from the FV ASP.NET Core adapters here

  2. I think this is something that wouldn't be solved by FairyBread, but by an existing globalization technique for FV. Surely there's a solution out there that folks can plug in already. Needs research.

Stretch goal 1. As mentioned previously, keen to not support data annotations, I'd like to keep this library focused solely on FluentValidation, but if enough people ask I'm open to considering how we might do it. Maybe there's a benefit for people exposing annotated EF models directly as inputs, but I personally would never be doing that.

benmccallum avatar Feb 20 '21 16:02 benmccallum