Skip to content

swagger-codegen -l html2 does not include enums if object is using inheritance and the field is missing description #5331

@jan-matejka

Description

@jan-matejka
Description

swagger-codegen -l html2 does not include enums if object is using inheritance and the field is missing description

Swagger-codegen version

current master; HEAD = 5de04fa

Swagger declaration file content or url
swagger: '2.0'

info:
  title: "sscce"
  version: '1.0'
  description: sscce

definitions:
  Bar:
    type: object
    properties:
      bar:
        type: string

  Foo:
    allOf:
      - $ref: "#/definitions/Bar"
      - type: object
        properties:
          foo:
            type: string
            enum:
              - qux
              - quux

paths:
  /foo:
    post:
      parameters:
        - name: foo
          in: body
          schema: {$ref: "#/definitions/Foo"}
      responses:
        "200":
          description: foo
          type: string
Command line used for generation

JAR=".../swagger-codegen.git/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
java -jar "${JAR}" generate -i ~/sscce.yaml -l html2 -o foo

In the result, the Foo.foo enum is not rendered. If you either remove inheritance or add description to Foo.foo, the enums are rendered again.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions