Skip to content

UseOneOfForPolymorphism puts discriminator in useless place in swagger-file #1439

@SimonSimCity

Description

@SimonSimCity

VERSION:

6.5.0

STEPS TO REPRODUCE:

Create an endpoint with an abstract class which is extended by two classes, whose instances could properly be returned at this endpoint. Enable UseOneOfForPolymorphism and set SelectDiscriminatorNameUsing and SelectDiscriminatorValueUsing.

EXPECTED RESULT:

As UseOneOfForPolymorphism replaces the usage of the abstract-class by a list of oneOf definition, containing the two classes extending it, the property discriminator should be on the oneOf definitions.

ACTUAL RESULT:

The property discriminator is instead defined on the component definition of the abstract class, where it's quite useless.

ADDITIONAL DETAILS

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions