-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Revert #3377 #3436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert #3377 #3436
Conversation
There was a problem hiding this 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 asT
, 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 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ 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
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:
|
Manually revert changes from #3377.
Resolves #3425.