api-design.easyAPI-DESIGN click a line to flag it1@GetMapping("/api/orders")
2public List<OrderDto> listOrders(@RequestParam Long customerId) {
3 List<Order> orders = orderRepository.findByCustomerId(customerId);
4 return orders.stream()
5 .map(OrderDto::from)
6 .collect(Collectors.toList());
7}
no lines flagged
#112PracticeEasy10 min · 50 XP
Collection Endpoint Returns an Unbounded List
An endpoint that was fast for months starts timing out and spiking API memory once the largest customer crosses a few hundred thousand records.
Flagged linesNo lines flagged yet
Flag a line or write a note to submit.