zally
zally copied to clipboard
`x-zally-ignore`: explanation must be mandatory for each ignored rule
Currently, x-zally-ignore
extension accepts a set of RuleId
s to be ignored. This is a great feature, but we have to assure the correct usage of it. Let's begin with understanding the behaviour of the users.
We want the API designers to explicitly state a reason why the desicion has been made to ignore the rule. Therefore, the interface has to change from:
x-zally-ignore:
type: array
items:
type: string
to
x-zally-ignore:
type: array
items:
type: object
required:
- rule_id
- reason
properties:
rule_id:
type: string
reason:
type: string
Acceptance criteria
- [ ] Rules are not deactivated if no reason provided
- [ ] RESTful API is adjusted (reason is mandatory)
- [ ] New check is implemented which creates violations if reason is not provided (a
MUST
violation, can be linked to Zalando rule 100: https://opensource.zalando.com/restful-api-guidelines/#100)
Sounds great... a few additional thoughts...
- We have a bunch of API definitions using the current format already, would be good if we could have some transition period where the code is capable of understanding both styles. Perhaps a separate
@Check
for deprecated use ofx-zally-ignore
? - Should make sure
AvoidXZallyIgnoreRule
works properly with the new style ignores (ideally while continuing to support the old way for a while - see above) - Most of openapi properties are defined lowerCamelCase so I think
rule_id
would be better asruleId
or justrule
.