Skip to content

Conversation

@martincostello
Copy link
Collaborator

Cherry-pick some changes from #3646 to reduce the diff.

Cherry-pick some changes from #3646 to reduce the diff.
@martincostello martincostello added this to the v10.0.1 milestone Nov 11, 2025
Copilot AI review requested due to automatic review settings November 11, 2025 18:00
@martincostello martincostello enabled auto-merge (rebase) November 11, 2025 18:00
Copilot finished reviewing on behalf of martincostello November 11, 2025 18:02
@codecov
Copy link

codecov bot commented Nov 11, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.75%. Comparing base (70e4cb3) to head (7854a5c).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3647   +/-   ##
=======================================
  Coverage   94.75%   94.75%           
=======================================
  Files         110      110           
  Lines        3831     3834    +3     
  Branches      760      764    +4     
=======================================
+ Hits         3630     3633    +3     
  Misses        201      201           
Flag Coverage Δ
Linux 94.75% <100.00%> (+<0.01%) ⬆️
Windows 94.75% <100.00%> (+<0.01%) ⬆️
macOS 94.75% <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:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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 prepares the codebase for OpenAPI.NET 3.0 by updating type instantiations and adding type checks to handle the transition from concrete types to interface types in the OpenAPI.NET library.

  • Replaces target-typed new() expressions with explicit new OpenApiMediaType() in test and benchmark files
  • Adds type checks before accessing properties on dictionary values that may return interface types
  • Updates package versions for test dependencies
  • Changes explicit type declarations to var in TryGetValue calls for consistency

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/Swashbuckle.AspNetCore.SwaggerGen.Test/VerifyTests.cs Updated test instantiations from target-typed new to explicit OpenApiMediaType constructor
test/Swashbuckle.AspNetCore.SwaggerGen.Test/SwaggerGenerator/SwaggerGeneratorTests.cs Updated test instantiations from target-typed new to explicit OpenApiMediaType constructor
src/Swashbuckle.AspNetCore.SwaggerGen/XmlComments/XmlCommentsRequestBodyFilter.cs Added type checks before casting Content dictionary values to concrete OpenApiMediaType
src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs Added type checks and continue logic to safely handle interface types in Content dictionaries
src/Swashbuckle.AspNetCore.ApiTesting/ResponseValidator.cs Changed explicit type to var in TryGetValue for consistency
src/Swashbuckle.AspNetCore.ApiTesting/RequestValidator.cs Changed explicit type to var in TryGetValue for consistency
perf/Swashbuckle.AspNetCore.Benchmarks/XmlCommentsBenchmark.cs Updated benchmark instantiation from target-typed new to explicit OpenApiMediaType constructor
Directory.Packages.props Updated test dependency versions (MartinCostello.Logging.XUnit.v3, Microsoft.Playwright, Microsoft.NET.Test.Sdk, NSwag.MSBuild)

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

@martincostello martincostello merged commit 5bb0e76 into master Nov 11, 2025
20 checks passed
@martincostello martincostello deleted the prepare-for-OpenAPI3.2 branch November 11, 2025 18:10
This was referenced Nov 12, 2025
This was referenced Nov 13, 2025
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