Skip to content

Revert extracting inline focused config records from RefitGeneratorSettings#1157

Merged
christianhelle merged 8 commits into
mainfrom
revert-refitgeneratorsettings-focused-config-records
Jun 18, 2026
Merged

Revert extracting inline focused config records from RefitGeneratorSettings#1157
christianhelle merged 8 commits into
mainfrom
revert-refitgeneratorsettings-focused-config-records

Conversation

@christianhelle

@christianhelle christianhelle commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Inlines all 8 focused config records (OpenApiSourceConfig, ParameterConfig, TypeConfig, FilterConfig, SchemaConfig, FeatureConfig, OutputConfig, CodeGenerationConfig) back into RefitGeneratorSettings since they are not used by any other module.

  • Deletes 8 files, removes 758 lines of forwarding boilerplate
  • All properties are now direct auto-properties with defaults
  • Split across 8 clean commits for traceability
  • Full build and all 2237 tests pass

Summary by CodeRabbit

Release Notes

Refactor

  • Consolidated internal settings architecture by merging multiple configuration classes into a single unified RefitGeneratorSettings model, improving code organization and maintainability while preserving all existing functionality and maintaining full backward compatibility.

@christianhelle christianhelle added enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code labels Jun 17, 2026
@christianhelle christianhelle self-assigned this Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e64298ad-3b09-4145-b1c5-c31d13046a6e

📥 Commits

Reviewing files that changed from the base of the PR and between 2171c36 and 03e9b37.

📒 Files selected for processing (9)
  • src/Refitter.Core/Settings/CodeGenerationConfig.cs
  • src/Refitter.Core/Settings/FeatureConfig.cs
  • src/Refitter.Core/Settings/FilterConfig.cs
  • src/Refitter.Core/Settings/OpenApiSourceConfig.cs
  • src/Refitter.Core/Settings/OutputConfig.cs
  • src/Refitter.Core/Settings/ParameterConfig.cs
  • src/Refitter.Core/Settings/RefitGeneratorSettings.cs
  • src/Refitter.Core/Settings/SchemaConfig.cs
  • src/Refitter.Core/Settings/TypeConfig.cs
💤 Files with no reviewable changes (8)
  • src/Refitter.Core/Settings/TypeConfig.cs
  • src/Refitter.Core/Settings/CodeGenerationConfig.cs
  • src/Refitter.Core/Settings/SchemaConfig.cs
  • src/Refitter.Core/Settings/OutputConfig.cs
  • src/Refitter.Core/Settings/FilterConfig.cs
  • src/Refitter.Core/Settings/FeatureConfig.cs
  • src/Refitter.Core/Settings/ParameterConfig.cs
  • src/Refitter.Core/Settings/OpenApiSourceConfig.cs

📝 Walkthrough

Walkthrough

Seven dedicated settings classes (CodeGenerationConfig, FeatureConfig, FilterConfig, OpenApiSourceConfig, OutputConfig, ParameterConfig, SchemaConfig, TypeConfig) are deleted. All properties previously held by those classes are migrated directly onto RefitGeneratorSettings as public auto-properties with inline default initializers, and the two default constants move with them.

Changes

Settings Flattening

Layer / File(s) Summary
Constants, OpenAPI source, and namespace settings
src/Refitter.Core/Settings/RefitGeneratorSettings.cs, src/Refitter.Core/Settings/OpenApiSourceConfig.cs, src/Refitter.Core/Settings/OutputConfig.cs
DefaultOutputFolder and DefaultNamespace are hardcoded on RefitGeneratorSettings; OpenApiPath/OpenApiPaths and Namespace/ContractsNamespace become direct auto-properties. OpenApiSourceConfig and OutputConfig classes are deleted.
Code generation and header/response feature flags
src/Refitter.Core/Settings/RefitGeneratorSettings.cs, src/Refitter.Core/Settings/CodeGenerationConfig.cs
Generation toggles (GenerateContracts, GenerateClients, GenerateXmlDocCodeComments, etc.) and header/response flags (AddAutoGeneratedHeader, AddAcceptHeaders, ResponseTypeOverride, TypeAccessibility, etc.) become direct auto-properties with explicit defaults. CodeGenerationConfig is deleted.
Filter, namespace, interface, and path/tag settings
src/Refitter.Core/Settings/RefitGeneratorSettings.cs, src/Refitter.Core/Settings/FilterConfig.cs, src/Refitter.Core/Settings/ParameterConfig.cs
AdditionalNamespaces, ExcludeNamespaces, MultipleInterfaces, IncludePathMatches, IncludeTags, GenerateDeprecatedOperations, OptionalParameters, OutputFolder, and OutputFilename migrate to direct auto-properties. FilterConfig and ParameterConfig are deleted.
Schema trimming, type codegen, and output file settings
src/Refitter.Core/Settings/RefitGeneratorSettings.cs, src/Refitter.Core/Settings/SchemaConfig.cs, src/Refitter.Core/Settings/TypeConfig.cs
TrimUnusedSchema, KeepSchemaPatterns, IncludeInheritanceHierarchy, OperationNameGenerator, GenerateDefaultAdditionalProperties, ImmutableRecords, ApizrSettings, UseDynamicQuerystringParameters, and GenerateMultipleFiles become direct auto-properties. SchemaConfig and TypeConfig are deleted.
Serialization, security, AOT, and advanced feature settings
src/Refitter.Core/Settings/RefitGeneratorSettings.cs, src/Refitter.Core/Settings/FeatureConfig.cs
UsePolymorphicSerialization, ParameterNameGenerator, AuthenticationHeaderStyle, CollectionFormat, CustomTemplateDirectory, SecurityScheme, GenerateJsonSerializerContext, and ContractTypeSuffix migrate to direct auto-properties. FeatureConfig is deleted.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • christianhelle/refitter#1148: This PR directly reverses that PR's introduction of the component *Config record types that are now removed and inlined back onto RefitGeneratorSettings.
  • christianhelle/refitter#1137: The SettingsMapper/ConventionMapper introduced there maps into RefitGeneratorSettings properties that are directly restructured by this PR.
  • christianhelle/refitter#936: Both PRs touch AuthenticationHeaderStyle and SecurityScheme on RefitGeneratorSettings, which this PR converts from FeatureConfig-backed accessors to direct auto-properties.

Poem

🐇 Hop, hop, I swept the nest,
Seven config boxes — laid to rest!
One flat class now holds the keys,
No more wrappers, no more delegates, please.
Auto-props with defaults bright,
RefitGeneratorSettings — tidy and light! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: reverting the extraction of eight configuration records back into RefitGeneratorSettings by consolidating them as inline properties.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch revert-refitgeneratorsettings-focused-config-records

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@christianhelle christianhelle changed the title refactor: inline focused config records into RefitGeneratorSettings Revert extracting inline focused config records from RefitGeneratorSettings Jun 17, 2026
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.74%. Comparing base (bb84065) to head (03e9b37).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1157   +/-   ##
=======================================
  Coverage   94.74%   94.74%           
=======================================
  Files          69       69           
  Lines        3156     3156           
=======================================
  Hits         2990     2990           
  Misses         62       62           
  Partials      104      104           
Flag Coverage Δ
unittests 94.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@christianhelle
christianhelle merged commit 0092aef into main Jun 18, 2026
14 of 15 checks passed
@christianhelle
christianhelle deleted the revert-refitgeneratorsettings-focused-config-records branch June 18, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, bug fix, or request .NET Pull requests that contain changes to .NET code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant