Skip to content

Fix document URL serialization#3773

Merged
martincostello merged 1 commit intomasterfrom
fix-null-coalescing
Feb 5, 2026
Merged

Fix document URL serialization#3773
martincostello merged 1 commit intomasterfrom
fix-null-coalescing

Conversation

@martincostello
Copy link
Collaborator

Pull Request

The issue or feature being addressed

#3772 (comment)

Details on the issue fix or feature implementation

Fix URLs not being serialized correctly if a custom JsonSerializerOptions is provided.

Fix URLs not being serialized correctly if a custom `JsonSerializerOptions` is provided.

See #3772 (comment).
@martincostello martincostello added this to the v10.1.2 milestone Feb 5, 2026
Copilot AI review requested due to automatic review settings February 5, 2026 13:35
@martincostello martincostello enabled auto-merge (squash) February 5, 2026 13:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug where document URLs were not being serialized correctly when custom JsonSerializerOptions were provided to SwaggerUI. The issue stemmed from incorrect use of the null-coalescing assignment operator (??=) in the previous implementation.

Changes:

  • Fixed the RespondWithDocumentUrls method to correctly branch between custom and default JSON serialization options
  • Simplified the code by replacing if-else logic with a ternary operator
  • Ensured proper type conversion when using the source-generated JSON context

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.93%. Comparing base (3d260bb) to head (ebc295e).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3773   +/-   ##
=======================================
  Coverage   94.93%   94.93%           
=======================================
  Files         111      111           
  Lines        3886     3886           
  Branches      783      783           
=======================================
  Hits         3689     3689           
  Misses        197      197           
Flag Coverage Δ
Linux 94.93% <100.00%> (ø)
Windows 94.93% <100.00%> (ø)
macOS 94.93% <100.00%> (ø)

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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@martincostello martincostello merged commit ee80ed2 into master Feb 5, 2026
20 checks passed
@martincostello martincostello deleted the fix-null-coalescing branch February 5, 2026 13:47
This was referenced Feb 5, 2026
This was referenced Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant