Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrays in models don't render #65

Open
stuartf opened this issue Mar 29, 2021 · 0 comments
Open

Arrays in models don't render #65

stuartf opened this issue Mar 29, 2021 · 0 comments

Comments

@stuartf
Copy link

stuartf commented Mar 29, 2021

I have a model like:

@ApiModel({
    description: "A Course",
    name: "Course",
})
export class CourseModel {
    @ApiModelProperty({
        required: true,
    })
    id!: number;
    @ApiModelProperty({
        required: true,
    })
    students: Array<Student>;
}

And the rendered swagger.json comes out with:

...
"Course":{
    "type":"object",
    "properties":{
        "id":{"type":"number"},
        "students":{"type":"array"}
    },
    "required":["id","students"],
    "description":"A Course"
}
...

It would seem that Course.properties.students is missing an element items that should contain a reference to the Student model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant