Skip to content

Conversation

martincostello
Copy link
Collaborator

Manually revert changes from #3377.

Resolves #3425.

Manually revert changes from #3377.

Resolves #3425.
@martincostello martincostello added this to the v8.1.3 milestone Jun 3, 2025
@Copilot Copilot AI review requested due to automatic review settings June 3, 2025 08:06
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

Revert enum nullability changes introduced in PR #3377, restoring previous behavior for nullable enums in schema generation and tests.

  • Tests adjusted to remove nullable enum variants and expect non-nullable schema references.
  • Integration test snapshots updated to drop Nullable suffix and schema definitions for nullable enums.
  • Core schema generation logic reverted to treat Nullable<T> the same as T, removing special‐case unwrapping and null‐enum handling.

Reviewed Changes

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

Show a summary per file
File Description
test/Swashbuckle.AspNetCore.SwaggerGen.Test/SchemaGenerator/JsonSerializerSchemaGeneratorTests.cs Removed InlineData cases for nullable enums
test/Swashbuckle.AspNetCore.Newtonsoft.Test/SchemaGenerator/NewtonsoftSchemaGeneratorTests.cs Adjusted expected enum counts and reference IDs for nullable enums
test/Swashbuckle.AspNetCore.IntegrationTests/snapshots/*.verified.txt (multiple files) Replaced *Nullable references with non-nullable schema names and removed nullable enum definitions
src/Swashbuckle.AspNetCore.SwaggerGen/SwaggerGenerator/SwaggerGenerator.cs Reverted unwrapping of nullable types when isRequired
src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/SchemaGenerator.cs Removed dataProperty nullability unwrapping and null‐enum handling
src/Swashbuckle.AspNetCore.SwaggerGen/SchemaGenerator/JsonSerializerDataContractResolver.cs Restored passing original type rather than unwrapped nullable
src/Swashbuckle.AspNetCore.Newtonsoft/SchemaGenerator/NewtonsoftDataContractResolver.cs Reverted to resolving contracts on the effective type

Copy link

codecov bot commented Jun 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.54%. Comparing base (b28e9c8) to head (c361462).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3436      +/-   ##
==========================================
- Coverage   93.55%   93.54%   -0.02%     
==========================================
  Files         110      110              
  Lines        3834     3825       -9     
  Branches      719      712       -7     
==========================================
- Hits         3587     3578       -9     
  Misses        247      247              
Flag Coverage Δ
Linux 93.54% <100.00%> (-0.02%) ⬇️
Windows 93.54% <100.00%> (-0.02%) ⬇️
macOS 93.54% <100.00%> (-0.02%) ⬇️

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 0d02875 into master Jun 3, 2025
11 checks passed
@martincostello martincostello deleted the revert-3377 branch June 3, 2025 08:10
This was referenced Jul 28, 2025
This was referenced Sep 22, 2025
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.

[Bug]: Behaviour change in 8.1.2 for nullable enums
1 participant