Skip to content

[HTML] Bug generating static HTML, generator omits parameter's object type when using array of objects as parameter #3498

@dmelo

Description

@dmelo
Description

If you have a yaml API spec with and an endpoint have a parameter that is an array of objects, the static HTML generated from that don't have the details about the parameter, that it is an array of a certain object.

Swagger-codegen version

I'm using the latest commit on master branch: 1886abb

Swagger declaration file content or url

If you have the following yaml describing the parameters of an endpoint:

      parameters:
          - name: list
            in: body
            required: true
            description: List of passages
            schema:
              title: List of passages
              type: array
              items:
                $ref: '#/definitions/Passage'

The generated HTML is:

    <h3 class="field-label">Request body</h3>
    <div class="field-items">
      <div class="param">list (required)</div>

      <div class="param-desc"><span class="param-type">Body Parameter</span> &mdash; List of passages </div>
    </div>  <!-- field-items -->

It omits 1) the type array of the parameter and 2) the type of the array item

Command line used for generation
java -jar ~/proj2/swagger-codegen/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i swagger.yaml -l html -o html
Steps to reproduce

Use the swagger-codegen-cli to generate an the static HTML documentation from an swagger.yaml that contains an endpoint with an array of objects as parameter.

Related issues

None that I know.

Suggest a Fix

It is probably omitting it just for the lack of implementation of what to do with that information.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions