Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First validator is used when more validators are used for one type #128

Open
FrantisekSidak opened this issue Mar 20, 2023 · 2 comments
Open

Comments

@FrantisekSidak
Copy link

Using version 6.0.0-beta.1 of MicroElements.Swashbuckle.FluentValidation package.

For one contract object I use more validators with different rules. It is complex type, so SetValidator is used inside (also more than single validation for type, depending on top level validator type).

Such setup presents single validator rule sets in openapi, which does not reflects the configuration. Validation works as expected.

@petriashev
Copy link
Member

Hello @FrantisekSidak
Can you add an example?

@petriashev
Copy link
Member

Maybe IsOneValidatorForType option will help

            services.AddFluentValidationRulesToSwagger(configure: options =>
            {
                options.ValidatorSearch = new ValidatorSearchSettings()
                {
                    IsOneValidatorForType = false,
                    SearchBaseTypeValidators = true
                };
            });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants