Contract post processing adapters in GeneratorPipeline#1138
Contract post processing adapters in GeneratorPipeline#1138christianhelle wants to merge 5 commits into
Conversation
Add IContractsPostProcessor interface for post-generation contract transformation. Create Swagger2OptionalReferenceNullabilityNormalizer and EnumStringConverterInjector implementations, extracted from GeneratorPipeline.SanitizeGeneratedContracts and NormalizeSwagger2OptionalReferencePropertyNullability.
GeneratorPipeline now accepts XmlDocumentationGenerator, InterfaceGenerator, and IContractsPostProcessor collection via constructor instead of creating them inline. The three internal static helpers (SanitizeGeneratedContracts, NormalizeSwagger2OptionalReferencePropertyNullability, GenerateJsonSerializerContext) are removed from public API surface. SanitizeGeneratedContracts and NormalizeSwagger2OptionalReferencePropertyNullability now live in the IContractsPostProcessor implementations. GenerateJsonSerializerContext remains as a private helper called inline in Run().
Removed private wrapper methods (SanitizeGeneratedContracts, NormalizeSwagger2OptionalReferencePropertyNullability, GenerateJsonSerializerContext) that leaked pipeline internals. RunPipeline() now constructs GeneratorPipeline with real XmlDocumentationGenerator, InterfaceGenerator, and post-processors.
Update GeneratorPipelineTests to construct GeneratorPipeline with constructor args. Update RefitGeneratorAdvancedTests to test Swagger2OptionalReferenceNullabilityNormalizer and JsonSerializerContextGenerator directly instead of using reflection on removed private methods.
Test was using reflection on removed RefitGenerator.SanitizeGeneratedContracts method. Now tests EnumStringConverterInjector directly.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## improve-codebase-architecture #1138 +/- ##
================================================================
Coverage ? 94.75%
================================================================
Files ? 41
Lines ? 2669
Branches ? 0
================================================================
Hits ? 2529
Misses ? 46
Partials ? 94
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Summary
Implements PRD #2: GeneratorPipeline — Replacing Inline Dependencies with Injected Seams.
Changes
ew\
Verification