Performance: Grouping APIs by tags
MEDIUM IMPACT
This affects the API documentation load time and client-side rendering speed when browsing grouped endpoints.
@RestController @RequestMapping("/api/users") @Tag(name = "Users", description = "User management APIs") public class UserController { @GetMapping("") public List<User> getUsers() { ... } @PostMapping("") public User createUser() { ... } } @RestController @RequestMapping("/api/orders") @Tag(name = "Orders", description = "Order management APIs") public class OrderController { @GetMapping("") public List<Order> getOrders() { ... } }
@RestController @RequestMapping("/api") public class UserController { @GetMapping("/users") public List<User> getUsers() { ... } @PostMapping("/users") public User createUser() { ... } @GetMapping("/orders") public List<Order> getOrders() { ... } }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Flat list of all endpoints | High number of DOM nodes | Multiple reflows due to large layout | High paint cost from many elements | [X] Bad |
| Grouped endpoints by tags | Fewer DOM nodes initially | Single reflow per group expansion | Lower paint cost with smaller visible sets | [OK] Good |