Skip to content

[Bug]: attributes are moved to allOf instead of in the root of an object after updating from 6.5.0 to 6.6.2 #2964

@DerGary

Description

@DerGary

Describe the bug

The left side is generated through swagger cli with version 6.5.0 of the library, and the right sight is generated after updating to 6.6.2:
image
When this is now used to generate a client from it it contains the following properties:
image

Expected behavior

Left Side

Actual behavior

Right Side

Steps to reproduce

Create an empty type that inherits from a base class. We are using UseOneOfForPolymorphism as well as:

[SwaggerDiscriminator(ConnectionType.TypeDiscriminatorPropertyName)]
[SwaggerSubType(typeof(HttpConnectionConfigDto), DiscriminatorValue = ConnectionType.Http)]

Exception(s) (if any)

No response

Swashbuckle.AspNetCore version

6.6.2

.NET Version

net8.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions