swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

[HTML] Definition with array of definition objects does not generate property

Open kurtcarpenter opened this issue 8 years ago • 1 comments

Description

When creating a definition which is an array whose items are another definition, the generated static HTML file lists nothing under the array-typed definition.

Swagger-codegen version

2.2.1

Swagger declaration file content or url
swagger: '2.0'
definitions:
  Foo:
    type: array
    items:
      $ref: '#/definitions/Bar'
  Bar:
    type: object
    properties:
      blah:
        type: string
Command line used for generation

java -jar swagger-codegen-cli.jar generate -i swagger.yaml -l html

Steps to reproduce
  • Have a definition which is an array whose items are a $ref to another definition
  • Generate static HTML docs with -l html
  • Observe generated index.html contains an empty definition for the array-typed definition (Foo, in the above example)
Related issues/PRs

Possibly related to #6974

Suggest a fix/enhancement

kurtcarpenter avatar Feb 28 '18 06:02 kurtcarpenter

I have exactly the same problem, for both generated backend code in Java and frontend code in TypeScript. Properties with type "array" are not generated in the model classes.

nnworkspace avatar Jun 21 '18 11:06 nnworkspace