swagger-codegen
swagger-codegen copied to clipboard
[HTML] Definition with array of definition objects does not generate property
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.htmlcontains an empty definition for the array-typed definition (Foo, in the above example)
Related issues/PRs
Possibly related to #6974
Suggest a fix/enhancement
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.