vacuum is the worlds fastest OpenAPI 3, OpenAPI 2 / Swagger linter and quality analysis tool. Built in go, it tears through API specs faster than you can think. vacuum is compatible with Spectral rulesets and generates compatible reports.
I tried creating a new rule that used lengthin my ruleset, as described here
Problem
I copied and modified the check-the-length rule from the link above
check-the-length:
description: "Check the length of 'name' is at least 5 characters long"
type: style
recommended: true
given: $.tags[*]
then:
field: name
function: "length"
functionOptions:
min: 5
max: 8
and ran it against Asana's OpenAPI file, but it did not work - I made sure there were violations in the OpenAPI file so I know the rule is likely just not running.
My ruleset is extends: [[spectral:oas, all], [vacuum:owasp, all]] with a few others added in, including that check-the-length. I am pretty sure my other rules are working fine.
Description
I tried creating a new rule that used
length
in my ruleset, as described hereProblem
I copied and modified the
check-the-length
rule from the link aboveand ran it against Asana's OpenAPI file, but it did not work - I made sure there were violations in the OpenAPI file so I know the rule is likely just not running.
Repro
Command
vacuum spectral-report -r /Users/adrianmachado/Code/rate-my-openapi-cli/rulesets/rules.vacuum.yaml example-specs/asana.json
My ruleset is
extends: [[spectral:oas, all], [vacuum:owasp, all]]
with a few others added in, including thatcheck-the-length
. I am pretty sure my other rules are working fine.