Skip to content

Fix Discriminator with Composed Bundling - #443

Merged
daveshanley merged 4 commits into
pb33f:mainfrom
califlower:fix-discriminator-mapping-composed
Jul 31, 2025
Merged

Fix Discriminator with Composed Bundling#443
daveshanley merged 4 commits into
pb33f:mainfrom
califlower:fix-discriminator-mapping-composed

Conversation

@califlower

@califlower califlower commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

Composed Bundling Changes

  • Updates refs in discriminator mappings under composed bundling

fixes #433

Update discriminator mappings when external schemas are moved to
components during composed bundling. Discriminator mappings act
like $ref but aren't technically $ref nodes, so they need separate
handling to rewrite external references to component references.

- Add comprehensive test coverage for various edge cases
- Reuse existing reference rewriting infrastructure
- Handle mixed internal/external mappings gracefully
- Support oneOf/anyOf discriminator patterns
- Preserve invalid references unchanged
@codecov

codecov Bot commented Jul 30, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.64%. Comparing base (f3ba035) to head (72b563c).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #443   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files         169      169           
  Lines       23107    23170   +63     
=======================================
+ Hits        23025    23088   +63     
  Misses         77       77           
  Partials        5        5           
Flag Coverage Δ
unittests 99.64% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@califlower
califlower marked this pull request as ready for review July 30, 2025 19:46
@califlower

Copy link
Copy Markdown
Contributor Author

I think I'll consolidate the tests, not sure if we need like 7 discriminator tests, rather than 1 test that has all the cases

@daveshanley

Copy link
Copy Markdown
Member

I think I'll consolidate the tests, not sure if we need like 7 discriminator tests, rather than 1 test that has all the cases

It does not bother me, I actually prefer individual tests, it makes debugging specific parts of units easier in my opinion.

@daveshanley
daveshanley merged commit a7f6126 into pb33f:main Jul 31, 2025
4 checks passed
@califlower

Copy link
Copy Markdown
Contributor Author

ahh I didn't even see you merged this. I appreciate it a lot!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discriminator Mappings Not Updated During Bundling

2 participants