@Controller()
class Test {
@Get()
public find(): Promise<string[]> {}
}
This rule aims to reduce the size and thus the network weight of API returns that may contain many elements. This rule is built for the NestJS framework but can work with a controller @Controller() and a decorated method @Get().
Examples of non-compliant code for this rule:
@Controller()
class Test {
@Get()
public find(): Promise<string[]> {}
}
Examples of compliant code for this rule:
interface Pagination {
items: string[];
currentPage: number;
totalPages: number;
}
@Controller()
class Test {
@Get()
public find(): Promise<Pagination> {}
}