zally icon indicating copy to clipboard operation
zally copied to clipboard

Ignoring multiple rules id in zally

Open beena-yatin-kanyal opened this issue 3 years ago • 4 comments

I am evaluating the Zally tool and was wondering if we have some sort of regex to ignore the multiple rules at once?

I know I can have the rules ids specified in the ignoreRules attribute like below but this list will keep on increasing if I add some around 30 to 40 rules to be ignored.

# rules to be ignored system wide by default
# 115 - NoVersionInUriRule.kt
# 129 - KebabCaseInPathSegmentsRule.kt
ignoreRules: M008, M009, M010, M011, H001, H002, S005, S006, S007, 115, 129

Also as per the documentation this flag sets the ignore rule for the whole application? Is there any way through which I can give the rules-id in the client request? Maybe something from the front end which I can add? Any help would be greatly appreciated.

beena-yatin-kanyal avatar Nov 12 '21 15:11 beena-yatin-kanyal

You can specify the ignored rules in the request body to /api-violations using the ignore_rules property

jcolladosp avatar Nov 23 '21 08:11 jcolladosp

@jcolladosp thanks for your comment. can you please help me with a snippet? I would appreciate your help. somehow I have been struggling to add this property from the frontend code.

beena-yatin-kanyal avatar Nov 23 '21 15:11 beena-yatin-kanyal

@beena-yatin-kanyal

curl -X \
POST 'http://localhost:8080/api-violations' \
--header 'Content-Type: application/json' \
--data-raw '{
    "api_definition_string": "https://petstore.swagger.io/v2/swagger.json",
    "ignore_rules": ["218",...]
}'

You can see the api specification here: https://github.com/zalando/zally/blob/master/server/zally-server/src/main/resources/api/zally-api.yaml

jcolladosp avatar Nov 25 '21 10:11 jcolladosp

Thanks, @jcolladosp. Let me try this approach via the frontend code. Will share an update soon.

beena-yatin-kanyal avatar Dec 24 '21 14:12 beena-yatin-kanyal

Closing it for now. Feel free to reopen if needed.

vadeg avatar Oct 09 '22 11:10 vadeg