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
556 stars 44 forks source link

Dashboard panics when there are no linting warnings or errors #519

Closed kubauk closed 1 month ago

kubauk commented 2 months ago

When I have no errors in my openapi spec, dashboard fails to open and just panics out.

The lint command works and reports no errors and dashboard can only be used if there are issues to report.

Prompt ~/Google Drive/My Drive/src/payouts [PAYOUT-36_Accept_Payout_Requests] $ pnpm vacuum dashboard openapi.yaml INFO Linting against 44 rules: https://quobix.com/vacuum/rulesets/recommended panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]: github.com/daveshanley/vacuum/cui.(Dashboard).GenerateTabbedView(0x140007d3500) /home/runner/work/vacuum/vacuum/cui/dashboard.go:60 +0x378 github.com/daveshanley/vacuum/cui.(Dashboard).Render(0x140007d3500) /home/runner/work/vacuum/vacuum/cui/dashboard.go:126 +0x584 github.com/daveshanley/vacuum/cmd.GetRootCommand.GetDashboardCommand.func6(0x1400017b600?, {0x140003dcb20, 0x4?, 0x103831b45?}) /home/runner/work/vacuum/vacuum/cmd/dashboard.go:113 +0x480 github.com/spf13/cobra.(Command).execute(0x14000033500, {0x140003dcae0, 0x1, 0x1}) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:983 +0x840 github.com/spf13/cobra.(Command).ExecuteC(0x14000032600) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344 github.com/spf13/cobra.(*Command).Execute(...) /home/runner/go/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039 github.com/daveshanley/vacuum/cmd.Execute({0x103ac5754?, 0x19?}, {0x103ac6240?, 0x10389335d?}, {0x140003fe820?, 0x140000021a0?}) /home/runner/work/vacuum/vacuum/cmd/root.go:30 +0xbc main.main() /home/runner/work/vacuum/vacuum/vacuum.go:25 +0x184 Prompt ~/Google Drive/My Drive/src/payouts [PAYOUT-36_Accept_Payout_Requests] $ pnpm vacuum lint -d openapi.yaml

██╗ ██╗ █████╗ ██████╗██╗ ██╗██╗ ██╗███╗ ███╗ ██║ ██║██╔══██╗██╔════╝██║ ██║██║ ██║████╗ ████║ ██║ ██║███████║██║ ██║ ██║██║ ██║██╔████╔██║ ╚██╗ ██╔╝██╔══██║██║ ██║ ██║██║ ██║██║╚██╔╝██║ ╚████╔╝ ██║ ██║╚██████╗╚██████╔╝╚██████╔╝██║ ╚═╝ ██║ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝

version: 0.10.1 | compiled: Sat, 22 Jun 2024 14:44:08 UTC 🔗 https://quobix.com/vacuum | https://github.com/daveshanley/vacuum

INFO Linting file 'openapi.yaml' against 44 rules: https://quobix.com/vacuum/rulesets/recommended

      Linting passed, A perfect score! well done!
daveshanley commented 2 months ago

Whoops. Yes you are right. willfix.

daveshanley commented 1 month ago

Fixed in v0.12.0