Skip to content

swagger-codegen -l html2 would be much nicer looking if it treated inheritance as in programming language doc generatorsΒ #5166

@jan-matejka

Description

@jan-matejka
Description

swagger-codegen -l html2 would be much nicer looking if it treated inheritance as in programming language doc generators

Swagger declaration file content or url
swagger: '2.0'

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

definitions:

  Animal:
    type: object
    properties:
      number_of_legs:
        type: integer

  Pet:
    allOf:
      - $ref: "#/definitions/Animal"
      - type: object
        properties:
          name:
            type: string

  Cat:
    allOf:
    - $ref: "#/definitions/Pet"
    - type: object
      properties:
        likes_water:
          type: boolean


paths:
  /foo:
    post:
      parameters:
        - name: cat
          in: body
          schema: {$ref: "#/definitions/Cat"}
      responses:
        "200":
          description: foo
          type: string
Swagger-codegen version

current master; HEAD = 1c160df

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

Renders as:

actual

which would be much nicer as

desired

The pic is not that descriptive but I assume you know what you are looking at since swagger-codegen is written in java.

My first issue is with the indenting which by the shape of it looks more like composition and second is with the copy-paste use of allOf which will not be obvious to a person unfamiliar with the OpenAPI spec format itself.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions