Skip to content

[Validation]: tighten endpoint-filter gate so it only emits when AddE…#9

Merged
MistyKuu merged 1 commit intomasterfrom
claude/fix-validation-endpoint-filter
Apr 21, 2026
Merged

[Validation]: tighten endpoint-filter gate so it only emits when AddE…#9
MistyKuu merged 1 commit intomasterfrom
claude/fix-validation-endpoint-filter

Conversation

@MistyKuu
Copy link
Copy Markdown
Owner

…ndpointFilter resolves

Previously the generator emitted ValidationEndpointFilter.g.cs whenever Microsoft.AspNetCore.Http.Results resolved in the compilation. That type lives in Microsoft.AspNetCore.Http.Results.dll, while the generated source also calls RouteHandlerBuilder.AddEndpointFilter(...) which lives in Microsoft.AspNetCore.Http.Extensions.dll (class EndpointFilterExtensions).

Test projects that pulled Results in transitively — e.g. via a ProjectReference to an ASP.NET Core web sample used by WebApplicationFactory — but did not wire up the full minimal-API extension surface tripped the gate and then failed to compile with:

RouteHandlerBuilder does not contain a definition for AddEndpointFilter

Gate now requires all three types the emitted source uses — RouteHandlerBuilder, Results, and EndpointFilterExtensions — so the filter source is only emitted when the compilation actually has a chance of compiling it.

@MistyKuu MistyKuu force-pushed the claude/fix-validation-endpoint-filter branch from 2daebe1 to 2c6409a Compare April 21, 2026 08:08
…ndpointFilter resolves

Previously the generator emitted ValidationEndpointFilter.g.cs whenever
`Microsoft.AspNetCore.Http.Results` resolved in the compilation. That type
lives in Microsoft.AspNetCore.Http.Results.dll, while the generated source
also calls `RouteHandlerBuilder.AddEndpointFilter(...)` which lives in
Microsoft.AspNetCore.Http.Extensions.dll (class EndpointFilterExtensions).

Test projects that pulled `Results` in transitively — e.g. via a
ProjectReference to an ASP.NET Core web sample used by
WebApplicationFactory — but did not wire up the full minimal-API
extension surface tripped the gate and then failed to compile with:

  RouteHandlerBuilder does not contain a definition for AddEndpointFilter

Gate now requires all three types the emitted source uses — RouteHandlerBuilder,
Results, and EndpointFilterExtensions — so the filter source is only
emitted when the compilation actually has a chance of compiling it.
@MistyKuu MistyKuu force-pushed the claude/fix-validation-endpoint-filter branch from 2c6409a to 51e0814 Compare April 21, 2026 08:08
@MistyKuu MistyKuu merged commit b81950f into master Apr 21, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant