Skip to content

Propagate JsonLibraryVersion and preserve ImmutableRecords for GenerateNativeRecords#1141

Merged
christianhelle merged 6 commits into
mainfrom
refactor-schema-mutations
Jun 14, 2026
Merged

Propagate JsonLibraryVersion and preserve ImmutableRecords for GenerateNativeRecords#1141
christianhelle merged 6 commits into
mainfrom
refactor-schema-mutations

Conversation

@christianhelle

@christianhelle christianhelle commented Jun 14, 2026

Copy link
Copy Markdown
Owner

Fixes

Two bugs in CSharpClientGeneratorFactory.cs:

  1. GenerateNativeRecords overwritten by ApplyCodeGeneratorSettings — When ImmutableRecords was true, the initializer correctly set GenerateNativeRecords = true, but ApplyCodeGeneratorSettings then overwrote it with the default \ alse\ from CodeGeneratorSettings.GenerateNativeRecords. Fixed by reapplying the combined logic after ApplyCodeGeneratorSettings.

  2. JsonLibraryVersion never propagated to NSwag — The ApplyCodeGeneratorSettings method was missing destination.JsonLibraryVersion = source.JsonLibraryVersion;, so setting JsonLibraryVersion = 9.0 had no effect.

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

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@christianhelle, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 23 minutes. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0917e5b6-582a-4c88-be1c-bc041a97ba68

📥 Commits

Reviewing files that changed from the base of the PR and between 7d03c6a and 8dcd6f1.

📒 Files selected for processing (15)
  • src/Refitter.Core/CSharpClientGeneratorFactory.cs
  • src/Refitter.Core/CustomIntegerTypeMutator.cs
  • src/Refitter.Core/CustomTemplateFactory.cs
  • src/Refitter.Core/DisableAdditionalPropertiesMutator.cs
  • src/Refitter.Core/FixMissingIntegerTypesMutator.cs
  • src/Refitter.Core/IOpenApiDocumentMutator.cs
  • src/Refitter.Core/JsonSchemaReferenceComparer.cs
  • src/Refitter.Core/OneOfDiscriminatorToAllOfMutator.cs
  • src/Refitter.Core/SafeSchemaTypeNameGenerator.cs
  • src/Refitter.Core/SchemaWalker.cs
  • src/Refitter.Tests/CSharpClientGeneratorFactoryIntegrationTests.cs
  • src/Refitter.Tests/CustomIntegerTypeMutatorTests.cs
  • src/Refitter.Tests/DisableAdditionalPropertiesMutatorTests.cs
  • src/Refitter.Tests/FixMissingIntegerTypesMutatorTests.cs
  • src/Refitter.Tests/OneOfDiscriminatorToAllOfMutatorTests.cs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor-schema-mutations

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.

@sonarqubecloud

Copy link
Copy Markdown

@christianhelle christianhelle changed the title fix: propagate JsonLibraryVersion and preserve ImmutableRecords for GenerateNativeRecords Propagate JsonLibraryVersion and preserve ImmutableRecords for GenerateNativeRecords Jun 14, 2026
@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.54962% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.67%. Comparing base (78d783b) to head (8dcd6f1).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
.../Refitter.Core/OneOfDiscriminatorToAllOfMutator.cs 76.19% 1 Missing and 4 partials ⚠️
src/Refitter.Core/SchemaWalker.cs 91.80% 4 Missing and 1 partial ⚠️
src/Refitter.Core/SafeSchemaTypeNameGenerator.cs 83.33% 0 Missing and 3 partials ⚠️
...efitter.Core/DisableAdditionalPropertiesMutator.cs 75.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1141      +/-   ##
==========================================
- Coverage   94.73%   94.67%   -0.06%     
==========================================
  Files          39       47       +8     
  Lines        2658     2910     +252     
==========================================
+ Hits         2518     2755     +237     
- Misses         46       52       +6     
- Partials       94      103       +9     
Flag Coverage Δ
unittests 94.67% <88.54%> (-0.06%) ⬇️

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 7af7c4c into main Jun 14, 2026
13 of 15 checks passed
@christianhelle
christianhelle deleted the refactor-schema-mutations branch June 14, 2026 16:53
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