Skip to content

discriminator generated in both base and child #3829

@AlexNolasco

Description

@AlexNolasco
Description

Should the discriminator property be also a property of the child class even if it is already in the base class?

Swagger-codegen version

2.2

Swagger declaration file content or url

ticket.yaml.txt

Command line used for generation

Objective-C and C# client generators generate the petType in the base and child class. Thus generating compilation warnings. OTOH, the Java generator does not duplicate the property.

Steps to reproduce

Simply generate C# or Objective-C client code for the YAML aforementioned

Related issues
Suggest a Fix

Child classes should not duplicate properties found in the base class. The work around is to only define the discriminator in the base class and then copy/paste the property on each child class.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions