Introducing Vacuum: A High-Speed Linter for OpenAPI and Swagger
Vacuum is hailed as the world's fastest OpenAPI and Swagger linter and quality-checking tool. Developed in the lightweight programming language Golang, Vacuum is inspired by another popular linter called Spectral. It offers full compatibility with existing Spectral rulesets, allowing users to bring in their custom rules from Spectral, if any.
Key Features of Vacuum
Speed and Efficiency
A prominent feature of Vacuum is its incredible speed. Significant improvements have been made over time to ensure it processes large documents with unrivaled efficiency. Recent updates in version v0.14+
boast enhanced engine speed, ensuring even faster execution.
JSON Path Support
Starting with version v0.12+
, all core functions in Vacuum now support JSON Path, providing more accurate results. This update means users can expect precise linting outcomes due to the enhanced core function capabilities.
Error Ignoring and Compatibility
Version v0.11+
introduced the ability to ignore specific linting errors. This functionality is particularly beneficial when implementing new rules for existing production APIs, as it allows backward compatibility without necessitating immediate corrections that could disrupt existing functionality.
Quality and Flexibility
The v0.10+
release focused on quality improvements, fixing several issues related to rule schemas and function names. Additionally, Vacuum provides flexibility to run as both a standalone CLI and a library, which can be integrated into other applications.
Additional Functionalities
With numerous versions come additional tools such as:
- Language Server: Available from version
v0.9+
, Vacuum can function as a Language Server Protocol (LSP), providing real-time linting and validation in popular IDEs like VSCode. - OpenAPI Bundler: Introduced in version
v0.8+
, this feature allows users to consolidate all external references of an OpenAPI file into a single bundle. - Hard Mode and Multi-file Linting: Users can enable 'hard mode' for strict linting rules and also lint multiple files simultaneously.
Installation and Usage
Vacuum offers multiple installation options, making it accessible to a broad audience with varying technical preferences. It can be easily installed through Homebrew, npm, yarn, or directly via curl command. For containerization fans and environments, a Docker image is also available.
The tool's comprehensive CLI supports diverse commands such as lint
, dashboard
, html-report
, among others, providing flexibility in generating reports and evaluating OpenAPI specifications.
Interactive Dashboard and Reporting
Vacuum enhances user experience with an interactive dashboard allowing visualization of linting results and rules violations in a console environment. For those who prefer web-based outputs, Vacuum can generate HTML reports easily navigable in standard web browsers.
Community and Documentation
For developers or companies using Vacuum, sponsorship options are available to support continued development. A lively community hub on Discord exists for sharing experiences, resolving queries, and engaging with other users and developers.
Extensive documentation supports users in getting started with Vacuum, understanding its functionalities, and exploring advanced features like custom JavaScript functions and OWASP API rules.
Conclusion
Vacuum stands out as a fast, flexible, and extremely efficient tool for OpenAPI and Swagger linting. Its comprehensive feature set, community support, and continuous improvements make it an invaluable tool for API developers everywhere. Whether you’re handling large OpenAPI specs or ensuring compliance in continuous integration workflows, Vacuum delivers speed and precision.