swagger-stylelisted
Install: claude install-skill dmitriy-iliyov/java-agent-skills
# Swagger style
House rules for springdoc-openapi annotations on a REST controller and its DTOs. An annotation that breaks one
of them is either wrong, or a reason to change the rule here deliberately.
Every string in an annotation is English. The annotations document decisions made elsewhere and make none of
their own: paths, verbs, statuses and whether `@ResponseStatus` is written at all follow the `controller-style`
skill ([../controller-style/SKILL.md](../controller-style/SKILL.md)); which errors an endpoint answers and what an
error response carries follow the `controller-advice-style` skill
([../controller-advice-style/SKILL.md](../controller-advice-style/SKILL.md)).
## What gets annotated
| Where | What it carries |
|---|---|
| **Endpoint method** | `@Operation(summary = ...)` and `@ApiResponses` - see [Responses](#responses) for which codes |
| **Path variable, query parameter** | `@Parameter(description = ...)`; a path variable also `required = true` |
| **Request / response record** | `@Schema(description = ...)` on the type and on every component - see [Fields](#fields) |
| **Enum used in a request or response** | `@Schema(description = ..., enumAsRef = true)` on the type, nothing on the constants - see [Fields](#fields) |
| **Query parameters bound through `@ModelAttribute`** | `@ParameterObject` on the method parameter - see [Traps](#traps) |
| **Type from a module without a springdoc dependency** | nothing, referenced through `implementation` - its fields sh