Skip to content

With a composed model (allOf), only set the model which holds a discriminator field as parent #245

Closed

Description

@cbornet

As per swagger spec's definition of allOf, inheritance should only be used in the case the parent model has a discriminator field.
The current implementation is to set the first model as parent but this results in issues with generated code (see swagger-api/swagger-codegen#2096)

Activity

  1. cbornet commented on May 19, 2016

    @cbornet
    ContributorAuthor

    After looking at the code, it seems difficult to do it in the parser because we only have the RefModel and not the ModelImpl and thus we don't know if it holds the discriminator.
    So maybe allOf shouldn't set the parent at all and it should be done afterwards by the codegen for the interface that has the discriminator.

  2. added 3 commits that reference this issue on May 19, 2016
    a344eaa
    94228de
    b55f595
  3. added a commit that references this issue on Jun 3, 2016
    be6f068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions