daveshanley / vacuum

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.
https://quobix.com/vacuum
MIT License
490 stars 39 forks source link

v0.6.0 Adds support for distributed rulesets. #395

Closed daveshanley closed 6 months ago

daveshanley commented 6 months ago

Add support for extending external rulesets, a feature requested by #254

Now rulesets can be extended easily using local files or remote files. vacuum also supports this feature recursively, which means entire chains of extension rulesets can be created.

The following syntax is now valid

extends:
  - 'spectral:oas'
  - ./rules/stringTypeConstraints.yaml
  - ../things/integerAndNumberTypeConstraints.yml
  - http://somedomain-out-there.com/path/to/rules.yaml
  - http://somwhere-else-out-there.com/more/rules.json

Adds support for feature #278

Added new -m and -b banner flags for lint command

The banner can now be disabled using the -b or —no-banner flag, as well as the message output (when using -d) can be disabled with the -m or the —no-message flags.

Adds support for #284

The rule has been downgraded to a warning from an error.

Adds support for #293

New -a / —all-results flag enables all result output #293

Want to see everything when using -d, well now you can.

Adds support for #318

message now overrides all core function messages #318

By adding a ‘message` property to a rule that uses a core function, any violations for that rule, will use the supplied message completely, vs the default output built into vacuum for that core function. This gives complete control over the message presented to users who violate the rule.

For example:

extends: [[spectral:oas, off]]
documentationUrl: https://quobix.com/vacuum/rulesets/custom-rulesets
rules:
  check-title-is-exactly-this:
    description: Check the title of the spec is exactly, 'this specific thing'
    severity: error
    message: you have to make the title 'this specific thing'
    recommended: true
    formats: [oas2, oas3]
    given: $.info
    then:
      field: title
      function: pattern
      functionOptions:
        match: 'this specific thing'
    howToFix: Make sure the title matches 'this specific thing'

Results in this: Screenshot 2023-12-13 at 11 01 40 AM

New version command

Will print out the current version vacuum version