Skip to content

DataAnnotations Validation not compatible with ServiceLocationPolicy.NotAllowed #4238

Description

@LodewijkSioen

Describe the bug
DataAnnotations Validation not compatible with ServiceLocationPolicy.NotAllowed

To Reproduce

  • Have a message with DataAnnotationAttributes.
  • Add opts.ServiceLocationPolicy = ServiceLocationPolicy.NotAllowed;
  • Add UseDataAnnotationsValidationProblemDetailMiddleware

Expected behavior
CodeGen should generate the handlers

Additional context
The DataAnnotationsHttpValidationExecutor requires IServiceProvider directly to create the DataAnnotations ValidationContext. Perhaps using IWolverineRuntime instead and pick the serviceprovider that's available there?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions