Enable module-specific OpenAPI documents - #19
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 298b671ac3
ℹ️ 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".
| var optionsRegistrations = registrations | ||
| .Where(registration => string.Equals( | ||
| registration.OptionsTypeName, | ||
| optionsType.Name, | ||
| StringComparison.Ordinal)) |
There was a problem hiding this comment.
Match registrations with fully qualified option types
When different modules declare options classes with the same simple name, this comparison credits every AddOptions<T>() occurrence to all of them because OptionsRegistration stores only type.Name. For example, registering ModuleA.SmtpOptions with ValidateOnStart() makes an unregistered ModuleB.SmtpOptions pass this check; the validator-registration check has the same simple-name collision. Preserve assembly/namespace-qualified type identity, ideally by resolving syntax with a semantic model, so the new convention cannot silently miss unvalidated options.
Useful? React with 👍 / 👎.
What changed
PANiXiDA.Core.Presentation.Httpfrom2.0.5-previewto stable2.0.6.HttpModulesconfiguration for theidentityandcompendiumOpenAPI documents and Scalar titles.Configurations/HttpConfiguration.cs.Configurations/Modules.Program.csto application composition and middleware orchestration.<Module>ModuleConfigurationinConfigurations/Modules.IValidateOptions<TOptions>validator in the same directory and to useValidateOnStart().Systemimports first and separate import groups, then applied the resulting mechanical using formatting.Why
The API currently exposes all module endpoints in one OpenAPI document. The stable HTTP package now supports module-specific documents, so Scalar can provide separate Identity and Compendium sources while assembly registration remains type-safe.
Keeping host and module configuration outside
Program.csmakes the composition root consistent. The architecture tests now enforce module configuration placement and fail-fast validation for strongly typed application configuration. Import ordering is enforced by the existing .NET formatting CI job.Verification
PANiXiDA.Core.Presentation.Http 2.0.6.Compatibility
identityandcompendiumdocuments instead of one combined module document.HttpModulesentries to the host configuration.