zally
zally copied to clipboard
New Rules
Prompted by @maxim-tschumak here's a list of the rules we have in house that could be moved upstream into Zally if there's interest:
- [x] Collection Resources Are Plural (
/thing/{id}should be/things/{id})- Generalized by PluralizeResourceNamesRule
- [x] Lower Camel Case Parameter Names (query and path parameters)
- Generalized by CaseCheckerRule
- [x] At Most One Body Parameter (remains Swagger based since OpenAPI implicitly enforces this)
- [ ] Collection Resources Return Arrays (directly opposes Zalando guidelines)
- [ ] Collection Resources Return Total-Items Header
- [ ] Paginated Resources Return Total-Pages Header
- [ ] Paginated Resources Support 'pageNumber' Query Parameter
- [ ] Paginated Resources Support 'pageSize' Query Parameter
- [ ] Path Parameters Are Proceeded by Plurals (
/{id}should be/things/{id}) - [ ] Matching Summary and OperationId (
operationId = lowerCamelCase(summary)) - [ ] POST Responding 200 Considered Suspicious (recommends 201 Created or 202 Accepted instead)
- [ ] PUT Operations Require Body Parameter
- [ ] Path Parameters Are Entire Path Components (disallows
/indexes-{id}) - [ ] Resources Start with /
- [ ] Resources Separated by Single /
- [x] Resources Avoid Trailing Slashes
Happy to consider some/all of these upstream either added to existing rulesets or a new one(s?).
Some of the rules can be merged with the Zalando ones, e.g. configurable parameter format rule - checking for valid (Camal|Snake|*)Case. These rules can be merged into the Zalando Rule Set.
Feel free to add other rules/checks into the Zally package or create a new one - ${yourOrganizationName}-ruleset :)