Skip to content

Conversation

martincostello
Copy link
Collaborator

@martincostello martincostello commented May 23, 2025

  • Drop support for netstandard2.0.
  • Bump version to 9.0.0.
  • Update all NuGet packages to their latest versions where possible.
  • Remove redundant NuGet package references.
  • Simplify code.
  • Remove public members annotated with [Obsolete].
  • Remove deprecated --serializeasv2 option.

Resolves #3396.

Will leave this in draft until at least the week of the 2nd June in case there are any issues that come in in the next week from the 8.1.x release that need quick patching (like #3424).

@martincostello martincostello added this to the v9.0.0 milestone May 23, 2025
@martincostello martincostello added dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code version-major A change suitable for release in a major version labels May 23, 2025
Copy link

codecov bot commented May 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.28%. Comparing base (fca506a) to head (c0e0c6c).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3422      +/-   ##
==========================================
+ Coverage   93.55%   94.28%   +0.73%     
==========================================
  Files         110      109       -1     
  Lines        3833     3728     -105     
  Branches      715      707       -8     
==========================================
- Hits         3586     3515      -71     
+ Misses        247      213      -34     
Flag Coverage Δ
Linux 94.28% <100.00%> (+0.73%) ⬆️
Windows 94.28% <100.00%> (+0.73%) ⬆️
macOS 94.28% <100.00%> (+0.73%) ⬆️

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.

- Drop support for `netstandard2.0`.
- Bump version to `9.0.0`.
- Update all NuGet packages to their latest versions where possible.
- Remove redundant NuGet package references.
- Simplify code.

Resolves #3396.
Remove public members annotated with `[Obsolete]`.
Remove deprecated `--serializeasv2` option.
Define the supported target frameworks in `Directory.Build.props` instead of in each project file.
Update NuGet packages to their latest versions.
@martincostello martincostello marked this pull request as ready for review June 13, 2025 15:13
@Copilot Copilot AI review requested due to automatic review settings June 13, 2025 15:13
@martincostello martincostello enabled auto-merge (squash) June 13, 2025 15:14
@martincostello martincostello merged commit 760886b into master Jun 13, 2025
11 checks passed
@martincostello martincostello deleted the gh-3396-drop-netstandard branch June 13, 2025 15:15
Copy link

@Copilot 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 drops netstandard2.0 support, bumps the major version to 9.0.0, updates and cleans up NuGet package references, and removes obsolete code and conditional compilation blocks.

  • Remove netstandard2.0 targets and related #if branches across all projects.
  • Switch project files to use $(DefaultTargetFrameworks) and bump VersionPrefix to 9.0.0.
  • Update package versions in Directory.Packages.props and remove redundant package references.
  • Simplify code by removing deprecated options and obsolete attributes.

Reviewed Changes

Copilot reviewed 109 out of 109 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Swashbuckle.AspNetCore.ReDoc/ReDocMiddleware.cs Removed netstandard conditional code and streamlined middleware serialization and redirects.
src/Swashbuckle.AspNetCore.Newtonsoft/Swashbuckle.AspNetCore.Newtonsoft.csproj Switched to $(DefaultTargetFrameworks), removed netstandard2.0 target and redundant refs.
src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftDataContractResolver.cs Simplified enum serialization checks; removed #if blocks around StartsWith char/string.
src/Swashbuckle.AspNetCore.Newtonsoft/DependencyInjection/NewtonsoftServiceCollectionExtensions.cs Removed obsolete alias import for MvcJsonOptions.
src/Swashbuckle.AspNetCore.Cli/Swashbuckle.AspNetCore.Cli.csproj Switched to $(DefaultTargetFrameworks), removed netstandard2.0 target.
src/Swashbuckle.AspNetCore.Cli/Program.cs Dropped deprecated --serializeasv2 flag and related code.
src/Swashbuckle.AspNetCore.ApiTesting/Swashbuckle.AspNetCore.ApiTesting.csproj Switched to $(DefaultTargetFrameworks), removed netstandard2.0 target.
src/Swashbuckle.AspNetCore.ApiTesting/ApiTestRunnerBase.cs Removed conditional compilation around status‐code check.
src/Swashbuckle.AspNetCore.ApiTesting.Xunit/Swashbuckle.AspNetCore.ApiTesting.Xunit.csproj Switched to $(DefaultTargetFrameworks), removed netstandard2.0 target.
src/Swashbuckle.AspNetCore.Annotations/Swashbuckle.AspNetCore.Annotations.csproj Switched to $(DefaultTargetFrameworks), removed netstandard2.0 target.
src/Swashbuckle.AspNetCore.Annotations/SwaggerSubTypesAttribute.cs Removed obsolete SwaggerSubTypesAttribute class.
src/Swashbuckle.AspNetCore.Annotations/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt Removed obsolete public‐API entries for SwaggerSubTypesAttribute.
src/Swashbuckle.AspNetCore.Annotations/PublicAPI/PublicAPI.Shipped.txt Removed obsolete public‐API entries for SwaggerSubTypesAttribute.
src/Swashbuckle.AspNetCore.Annotations/AnnotationsSwaggerGenOptionsExtensions.cs Removed legacy subtype selector code and #if blocks, inlined new C#12 collection expression.
src/Swashbuckle.AspNetCore.Annotations/AnnotationsOperationFilter.cs Removed conditional compilation around endpoint metadata retrieval.
Directory.Packages.props Bumped multiple package versions and removed deprecated references.
Directory.Build.props Added <DefaultTargetFrameworks> and updated <VersionPrefix> to 9.0.0.
Comments suppressed due to low confidence (2)

src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftDataContractResolver.cs:45

  • [nitpick] JsonConverterFunc is invoked multiple times per enum value. Consider computing the JSON representation once (e.g., using a local list) and reusing it for both the initial StartsWith check and the full enumValuesAsJson processing.
var serializeAsString = (enumValues.Length > 0) && JsonConverterFunc(enumValues.GetValue(0)).StartsWith('"');

src/Swashbuckle.AspNetCore.Annotations/AnnotationsSwaggerGenOptionsExtensions.cs:74

  • [nitpick] The C#12 collection expression [] may be unfamiliar to some readers. For clarity and wider compatibility, consider using Array.Empty<Type>() to explicitly return an empty array.
return [];

This was referenced Aug 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file .NET Pull requests that update .NET code version-major A change suitable for release in a major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drop support for netstandard2.0
1 participant