Skip to content

Wolverine.Http: request-body inference should exclude DbContext-derived parameters #3538

Description

@jeremydmiller

Spun off from the conjoined EF Core multi-tenancy epic (#3465) — API-friction finding 1 from building the ConjoinedMultiTenantedEfCore sample app (see the 2026-07-20 findings comment on #3465).

When a conjoined (or any injected) DbContext is the only complex non-route parameter on a [WolverinePost] endpoint, Wolverine.Http's body inference decides the DbContext parameter is the JSON request body and tries to deserialize the request into it — the endpoint 400s with "Invalid JSON format". The sample had to work around it by shaping endpoint signatures to dodge the inference.

Acceptance criteria

  • DbContext-derived parameter types are never selected as the inferred request body (they should resolve as service/builder-provided parameters).
  • Regression test in Wolverine.Http.Tests with a [WolverinePost] endpoint whose only complex parameter is a DbContext.
  • If a hard exclusion is deemed too magic, at minimum a loud diagnostic + docs warning on the EF Core + HTTP path.

Related: #3465.

🤖 Generated with Claude Code

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