Conversation
Fix URLs not being serialized correctly if a custom `JsonSerializerOptions` is provided. See #3772 (comment).
There was a problem hiding this comment.
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
RespondWithDocumentUrlsmethod 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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
JsonSerializerOptionsis provided.