Ahh, the traditional generated HTML report. Quite often, they are a real let-down.

I wanted to do something not awful when it comes to the HTML report. vacuum can generate a self-contained interactive UI experience for exploring linting results from an OpenAPI specification, or a vacuum report.

The report has no dependencies, and it makes no network calls. The HTML file that is generated, is fully self-contained, it can be used without an internet connection.

It’s ideal for rendering in a CI/CD pipeline, easily viewable by anyone.

The report is generated in milliseconds and loads just as fast, even for enormous specifications!

The report uses WebComponents via Lit, which means it renders really, really fast.


Build a report from an OpenAPI Spec

Use the html-report command followed by a path to your OpenAPI Spec. There is a second optional argument that allows the naming of the report file, otherwise it defaults to report.html.

vacuum html-report my-openapi-spec.yaml

There should be a file named report.html in the current working direction. Open it up in your favorite browser.s

Change the report output file

vacuum html-report my-openapi-spec.yaml new-name.html

Load a vacuum report

Load a vacuum report and render the results as they were recorded, without re-running any linting rules or indexing.

vacuum html-report <myspec-report-07-04-22-12-13-22.json.gz>

Flags

lint supports the following flags

Short Full Input Description
-d –disableTimestamp bool Disable the timestamp from being generated on the report.
-q –no-style bool Disable color and style console output (useful for CI/CD)

Global Flags

html-report supports the following global flags

Short Full Input Description
-r –ruleset string Use an existing ruleset file for linting
-p –base string Base URL or Base working directory to use for relative references
-u –remote string Load remote references automatically if possible (default is true)
-k –skip-check string Skip checking for a valid OpenAPI document, useful for linting fragments or non-OpenAPI documents
-g –timeout string How long (in seconds to wait) for a rule before it times out (default is 5 seconds)
-z –hard-mode string Enable every single built-in rule (including OWASP). Only for adventurers and brave souls.

Examples

Want to see an example report? Don’t have an OpenAPI spec?

Make sure you have checked out the source, and you’re in the vacuum directory, then you can use example specs:

Stripe

vacuum html-report model/test_files/stripe.yaml

Asana

vacuum html-report model/test_files/asana.yaml

Kubernetes

vacuum html-report model/test_files/k8s.yaml