Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
backend ruleP2stack specificStack: node
documentationapi-designswaggerdto
Give every documented API property a type, example, and description
API schema decorators should specify type, an example, and a clear description so generated documentation is complete and accurate.
PR: hegnar-investor-ws · org-mining-2026-06Created: Jun 17, 2026
Bad example
Old codetypescript
| 1 | @ApiProperty() |
| 2 | public numberOfReplies: number; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | @ApiProperty({ |
| 2 | type: Number, |
| 3 | example: 421, |
| 4 | description: 'Number of replies created by the user', |
| 5 | }) |
| 6 | public numberOfReplies: number; |
Explanation (EN)
Objašnjenje (HR)