github daveshanley/vacuum v0.12.0

latest releases: v0.14.2, v0.14.1, v0.14.0...
3 months ago

Before v0.12

All core functions returned the same path provided in the rule. This is because there was no way to determine the actual path due to limitations in some core dependencies.

This is explained here: #269 and was recently revived here: #527

After v0.12

All core functions now return the correct JSON path for all results. This is now possible because of two supporting library upgrades
that we control has facilitated this possibility, without depending on any upstream libs we don't control.

For example, the following ruleset:

rules:
  description-is-coffee:
    description: "check that every description is 'coffee'"
    given: $..description
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^coffee$"
  every-response-has-schema:
    description: "check that every media type for 200 response has a made up field called peanuts"
    given: $.paths.*.*.responses.200.content.*
    severity: error
    then:
      field: peanuts
      function: truthy

When run with the model/test_files/burgershop.openapi.yaml sample spec, results in output like this:

vacuum lint model/test_files/burgershop.openapi.yaml -r ruleset.yaml -d -m

However, now in v0.12+ the same command (and using the new --no-clip command) shows the actual path.

vacuum lint model/test_files/burgershop.openapi.yaml -r ruleset.yaml -d -m --no-clip

Changelog

Don't miss a new vacuum release

NewReleases is sending notifications on new releases.