Skip to content

Fix handling of nullable enums for 3.0#2920

Merged
baywet merged 4 commits into
microsoft:mainfrom
Youssef1313:nullable-enum
Jul 3, 2026
Merged

Fix handling of nullable enums for 3.0#2920
baywet merged 4 commits into
microsoft:mainfrom
Youssef1313:nullable-enum

Conversation

@Youssef1313

Copy link
Copy Markdown
Member

Previously, this scenario wasn't producing a type and wasn't producing a null value in the enum array.

This fixes it so that they are produced.

In the future, we could also avoid adding a oneOf with a single element in this scenario.

@Youssef1313 Youssef1313 requested a review from a team as a code owner July 1, 2026 16:35
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs Fixed
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs Fixed
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs Outdated
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs Outdated
Comment thread test/Microsoft.OpenApi.Tests/Models/OpenApiSchemaTests.cs Outdated
Comment thread test/Microsoft.OpenApi.Tests/Models/OpenApiSchemaTests.cs Outdated
Comment thread test/Microsoft.OpenApi.Tests/Models/OpenApiSchemaTests.cs
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs Fixed
@Youssef1313 Youssef1313 requested a review from baywet July 2, 2026 12:17
baywet
baywet previously approved these changes Jul 2, 2026

@baywet baywet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes!

@Youssef1313

Copy link
Copy Markdown
Member Author

@baywet Is there anything remaining to get this merged? Would we have a new version released before .NET 11 Preview 7 so that we try to get that in aspnetcore repo and possibly build some fixes on our side on top of this?

Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs Dismissed
Comment thread src/Microsoft.OpenApi/Models/OpenApiSchema.cs Outdated

@baywet baywet left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for making the changes!

@baywet baywet merged commit beb68f5 into microsoft:main Jul 3, 2026
9 checks passed
@Youssef1313 Youssef1313 deleted the nullable-enum branch July 3, 2026 14:23
@baywet baywet mentioned this pull request Jul 3, 2026
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.

4 participants