diff --git a/docs/guide/handlers/fluent-validation.md b/docs/guide/handlers/fluent-validation.md index c9397c96f..fe1b8901c 100644 --- a/docs/guide/handlers/fluent-validation.md +++ b/docs/guide/handlers/fluent-validation.md @@ -12,6 +12,12 @@ There is also an HTTP specific middleware for WolverineFx.Http that uses the `Pr [Fluent Validation Middleware for HTTP](/guide/http/fluentvalidation) for more information. ::: +::: warning +If you need to use IoC services in a Fluent Validation `IValidator` that might force Wolverine to use a service locator +pattern in the generated code (basically from `AddScoped(s => build it at runtime)`), we recommend instead using a +more explicit `Validate` or `ValidateAsync()` method directly in your message handler~~~~ class for the data input. +::: + You will frequently want or need to validate the messages coming into your Wolverine system for correctness or at least the presence of vital information. To that end, Wolverine has support for integrating the popular [Fluent Validation](https://docs.fluentvalidation.net/en/latest/) library via an unobtrusive middleware strategy diff --git a/docs/guide/http/fluentvalidation.md b/docs/guide/http/fluentvalidation.md index e27ef056d..0e81b00a3 100644 --- a/docs/guide/http/fluentvalidation.md +++ b/docs/guide/http/fluentvalidation.md @@ -1,5 +1,11 @@ # Fluent Validation Middleware for HTTP +::: warning +If you need to use IoC services in a Fluent Validation `IValidator` that might force Wolverine to use a service locator +pattern in the generated code (basically from `AddScoped(s => build it at runtime)`), we recommend instead using a +more explicit `Validate` or `ValidateAsync()` method directly in your HTTP endpoint class for the data input. +::: + Wolverine.Http has a separate package called `WolverineFx.Http.FluentValidation` that provides a simple middleware for using [Fluent Validation](https://docs.fluentvalidation.net/en/latest/) in your HTTP endpoints.