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
491 stars 39 forks source link

Error logs are printed when the JSON report is generated. #372

Closed aabedraba closed 7 months ago

aabedraba commented 7 months ago

Issue:

The following OpenAPI document contains references that are not resolved: https://pastebin.com/raw/9r1xKVu3

When running a spectral report against it, rolodex logs are printed with the report and the output is mixed.

$ vacuum spectral-report -o /swagger.json

2023-11-22 14:32:15 ERROR unable to open rolodex file
                      ├ file: /Users/aabedraba/github/zuplo/rate-my-openapi/apps/api/networkInterface.json
                      └ error: rolodex has no file systems configured, cannot open '/Users/aabedraba/github/zuplo/rate-my-openapi/apps/api/networkInterface.json'. Add a BaseURL or BasePath to your configuration so the rolodex knows how to resolve references

[ # <-- report has been generated
    {
        "code": "openapi-tags",
        "path": [
            "$[0]"
        ],
        "message": "Top level spec `tags` must not be empty, and must be an array: `tags`, is missing and is required",

Expected output:

daveshanley commented 7 months ago

This should be fixed with v0.5.1

aabedraba commented 7 months ago

Tested and works as expected. Thanks so much!