adonis-autoswagger: Nested or extend interface not working with @responseBody

If we define

@responseBody 200 - <GenericPaginationResponseInterface>

GenericPaginationResponseInterface

export interface GenericPaginationResponseInterface {
  meta: {
    total: number
    perPage: number
    currentPage: number
    lastPage: number
    firstPage: number
    firstPageUrl: string
    lastPageUrl: string
    nextPageUrl: string
    previousPageUrl: string
  }

  data: Array<string>
}

in swagger it shows like this

{
  "meta": {},
  "total": null,
  "per_page": null,
  "current_page": null,
  "last_page": null,
  "first_page": null,
  "first_page_url": null,
  "last_page_url": null,
  "next_page_url": null,
  "previous_page_url": null,
  "data": {}
}

is that an issue or I am doing something wrong? Also, I noticed that, if I extend an interface it doesn’t work as well.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

Fixed in 3.17.0

I haven’t looked into this one yet. well keep you posted once it’s done

"adonis-autoswagger": "^3.6.0"

this is waaaaaay behind… we’re on 3.16.0 now

"adonis-autoswagger": "^3.6.0"

its rapidoc, but shouldn’t make a difference

I just saw you are returning a paginated response… there is already a helper for that <Model[]>.paginated()

Hmmm… There seems to be an issue with nesting I didn’t account for. Will see what I can do.

Extended IFs are not supported yet.