swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
16.98k stars 6.03k forks source link

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

Open jan-matejka opened 7 years ago

jan-matejka commented 7 years ago
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 = 5de04fa6129fd22ddd32b0d03d17b1d82397d66e

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.

rdasan commented 2 years ago

Is there any further development in this issue. The same issue happens with html client gen not just html2 client gen. Also with html client gen adding a description even does not work