Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Tag OpenAPI/Swagger endpoints by domain, not a generic label
Group controllers in API docs under a meaningful domain tag (e.g. 'Portfolio'), never a catch-all like 'API'.
Bad example
| 1 | @ApiTags('API') |
| 2 | @Controller('portfolio') |
| 3 | export class PortfolioController { /* ... */ } |
Explanation (EN)
A generic 'API' tag dumps every controller into one section of the docs, so consumers can't navigate by feature.
Objašnjenje (HR)
Genericki tag 'API' baca svaki kontroler u jednu sekciju dokumentacije, pa potrosaci ne mogu navigirati po znacajci.
Good example
| 1 | @ApiTags('Portfolio') |
| 2 | @Controller('portfolio') |
| 3 | export class PortfolioController { /* ... */ } |
Explanation (EN)
A domain tag groups related endpoints together, making generated docs browsable by feature area.
Objašnjenje (HR)
Domenski tag grupira povezane endpointe zajedno, cineci generiranu dokumentaciju preglednom po podrucju znacajke.