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

Add more control over scoped injection of Fluent validators #946

Open
StellaAlexis opened this issue Jun 23, 2024 · 1 comment
Open

Add more control over scoped injection of Fluent validators #946

StellaAlexis opened this issue Jun 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@StellaAlexis
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The wolverine FluentHttp library currently registers fluent validators as singleton. This prevents the use of translated error messages and potential other usage of scoped/transient resources within the validators.

Describe the solution you'd like
I think the best solution would to have the options to pass the lifetime on 'UseFluentValidationProblemDetailMiddleware' with singleton as default value. Next to that an attribute can be added to modify the scope of a single validator.

@jeremydmiller
Copy link
Member

That's not 100% accurate. Wolverine registers validators as singletons if there are no constructors with arguments by default, and any concrete validators with dependencies as Scoped

@jeremydmiller jeremydmiller added the enhancement New feature or request label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants