zally icon indicating copy to clipboard operation
zally copied to clipboard

`x-zally-ignore`: explanation must be mandatory for each ignored rule

Open maxim-tschumak opened this issue 6 years ago • 1 comments

Currently, x-zally-ignore extension accepts a set of RuleIds 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)

maxim-tschumak avatar Jul 13 '18 13:07 maxim-tschumak

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 of x-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 as ruleId or just rule.

roxspring avatar Jul 13 '18 14:07 roxspring