Performance: @Parameter and @Schema annotations
LOW IMPACT
These annotations affect the API documentation generation and can impact the build time and bundle size of the generated OpenAPI spec.
Use minimal @Parameter and @Schema annotations only where necessary, rely on defaults and implicit naming. public ResponseEntity<User> getUser(String id) { // method body } public class User { public String id; public String name; }
public ResponseEntity<User> getUser(@Parameter(name = "id", description = "User ID", required = true) String id) { // method body } @Schema(description = "User model") public class User { public String id; public String name; }
| Pattern | Build Time Impact | Spec Size | Runtime Impact | Verdict |
|---|---|---|---|---|
| Detailed @Parameter and @Schema on all fields | High (slows build) | Large (+50-100kb) | None | [X] Bad |
| Minimal annotations, rely on defaults | Low (faster build) | Small | None | [OK] Good |