JamesRandall / FunctionMonkey

Write more elegant Azure Functions with less boilerplate, more consistency, and support for REST APIs. Docs can be found at https://functionmonkey.azurefromthetrenches.com
MIT License
294 stars 50 forks source link

Is it possible to access validator rules from within OpenApiCompiler? #87

Open pemibo1986 opened 5 years ago

pemibo1986 commented 5 years ago

Hi, I was wondering if I could access validation rules like the one from the example:

internal class HelloWorldCommandValidator : AbstractValidator<HelloWorldCommand>
{ 
    public HelloWorldCommandValidator()
    {
        RuleFor(x => x.Name).NotEmpty().MinimumLength(1).MaximumLength(50);
    }
}

from within OpenApiCompiler? I'm looking for a way to add validation infos to the generated .yaml file.

JamesRandall commented 5 years ago

I looked at doing this from Fluent Validate myself but when I looked the author specifically didn't support this sort of scenario (my memory may be fuzzy).

In the general sense - let me take a look. I think their may be some complexity around the way the runtime is setup in a minimal sense for compilation.