adonis-autoswagger
adonis-autoswagger copied to clipboard
Add computed value in annotations
Hi ! Amazing addon lib !
I would like to know if it's possible to add the possibility of getting @computed()?
In my case i have the following:
/**
* @all
* @summary Returns a list of all users
* @responseBody <200> - <User[]> - List of users
*/
async all({ response }: HttpContext) {}
My model User has some computed values like:
@computed()
get followingCount(): number {
return this.followings ? this.followings.length : 0;
}
@computed()
get followerCount(): number {
return this.followers ? this.followers.length : 0;
}
@computed()
get likesReceived(): number {
return this._likesReceived === null ? 0 : this._likesReceived;
}
But they didn't appear :'(
Hum, seems like a regression as it used to work in the past.
Ok, my bad, just put a public before your get and it will be parsed.
I think I could add an additional clause checking for "get ", since it's always public