Skip to content

[Java] CodegenModel's discriminator property is not set for a model when it is composed using allOf #4346

Open

Description

@sreeshas
Description

When a model A is composed from another model B, which has declared a discriminator,
discriminator field of CodegenModel for A should be value of discriminator field of model B.
But, it is set to null.

Consider test case "handle inheritance from composed model" in CodegenTest.java which uses
src/test/resources/2_0/allOfTest.yaml .
child.discriminator should be "disc". But it is null.

Swagger-codegen version

2.2.0

Swagger declaration file content or url

src/test/resources/2_0/allOfTest.yaml

Command line used for generation

client is java.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions