Preserve module metadata for custom route groups - #6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 84eba0967a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| IServiceProvider serviceProvider) | ||
| where TGroup : IEndpointGroup | ||
| { | ||
| var moduleRegistry = serviceProvider.GetService<HttpModuleRegistry>(); |
There was a problem hiding this comment.
Validate the service provider before dereferencing it
When serviceProvider is null, this newly added lookup throws NullReferenceException; for a group with no endpoint implementations, such as OtherEndpointGroup, the previous implementation never touched the provider and returned normally, while groups with endpoints delegated validation to ActivatorUtilities. Add an explicit ArgumentNullException.ThrowIfNull(serviceProvider) so this public argument fails deterministically rather than silently changing exception behavior.
AGENTS.md reference: AGENTS.md:L37-L37
Useful? React with 👍 / 👎.
What changed
HttpModulemetadata in the customRouteGroupBuilderoverload;/connect/*.Why
Module OpenAPI documents filter endpoints by
HttpModulemetadata. Custom route groups did not receive that metadata, so OAuth endpoints mapped under/connectdisappeared from the Identity document.Verification
dotnet restore PANiXiDA.Core.Presentation.Http.slnxdotnet format PANiXiDA.Core.Presentation.Http.slnx --verify-no-changes --no-restoredotnet build PANiXiDA.Core.Presentation.Http.slnx --configuration Release --no-restoreCompatibility