completecoding / serverless-auto-swagger

82 stars 48 forks source link

Extends functionality for BaseResponse #134

Open amirhmk opened 1 year ago

amirhmk commented 1 year ago

Is there any way to define a BaseResponse in the api-types.ts file so that it can be used in the rest of the responces?

Something like:

interface BaseResponse {
  total: number;
  page_size: number;
  page: number;
  prev_page: string;
  next_page: string;
}

interface ApiResponse extends BaseResponse {
  // BaseResponse would get destructure here implicitly 
  data: SpecificRecordsResponse[]
}

I tried the above approach, but it does not work out of the box. Not sure if there is another way or a config change that can make this happen?