Skip to content

[Bug]: Behaviour change in 8.1.2 for nullable enums #3425

@jadu-1337

Description

@jadu-1337

Describe the bug

After updating from 8.1.1 to 8.1.2, there is an issue with type names for nullable enums.

It appears that all enums that are used as nullable values, e.g. class Request { MyEnum? Value { get; set; } } have their schema name changed in the generated resulting OpenAPI spec from MyEnum to MyEnumNullable.

This breaks client code generation that relies on the type names to match C# source, e.g. when using NSwagGen with GenerateDtoTypes:false, the generated client code fails to compile because it references a non-existing MyEnumNullable.

Expected behavior

Schema names should match C# source names

Actual behavior

Schema names are altered.

Steps to reproduce

No response

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

8.1.2

.NET Version

9.0.5

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions