Skip to content

Fix Discriminator with Inline Bundling #436

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 28, 2025

Conversation

califlower
Copy link
Contributor

@califlower califlower commented Jul 11, 2025

I've closed my previous PR and decided to work on each issue piecemeal.

Inline Bundling Changes

  • No Longer Inlines oneOf or anyOf for any ref, if it contains a discriminator mapping

Cons: Changes the behavior for the digital ocean spec, which is unfortunate since it's sort of the benchmark. But also I don't think it was working 100% correctly before

- Fix inline bundling: preserve discriminator-referenced schemas as components instead of inlining them
- Fix composed bundling: properly resolve discriminator mappings to full component paths
- Add comprehensive tests to validate discriminator mapping preservation
- Prevents invalid bundled specs with broken discriminator references
Fix Bundling with Discriminator Mapping

Additional test with non existent discriminator

Fix Windows File Handles

Remove unrealistic conditions

Re-Add Comment

Add space

Test last case

Remove test logging

Fix

Fix last test

Checkpoint

Start from failure

Fix Discriminator with Inline Bundling
@califlower califlower marked this pull request as ready for review July 11, 2025 16:28
@califlower califlower marked this pull request as draft July 11, 2025 16:32
Copy link

codecov bot commented Jul 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.64%. Comparing base (07e3df9) to head (16dc9eb).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #436   +/-   ##
=======================================
  Coverage   99.63%   99.64%           
=======================================
  Files         169      169           
  Lines       22893    22962   +69     
=======================================
+ Hits        22809    22880   +71     
+ Misses         79       77    -2     
  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 11, 2025 17:25
Copy link
Member

@daveshanley daveshanley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for the upgrade,

@daveshanley daveshanley merged commit c1f876d into pb33f:main Jul 28, 2025
4 checks passed
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.

2 participants