#type: Array<MyClass> not working

1 messages · Page 1 of 1 (latest)

hushed geyser
#

Giving an api response type: Array<MyClass>results in an infinite loading spinner in the swagger ui, just doing type: MyClass works fine, the problem is of course that the endpoint doesn't return that, it puts out an array. Here is the full snippet

    @ApiResponse({
        type: Array<MyClass>
    })
    async listStuff(): Promise<Array<MyClass>> {
        return (await this.stuff.list()).data;
    }
barren coral
#

I would say it is [MyClass]

silver haven
hushed geyser
#

isarray worked, thanks @silver haven

#

new problem though

#

I have an array of myclass2 inside myclass, but swagger shows the array as just [string]

hushed geyser