Skip to content

openapi-changes console crashes when comparing two files #243

@ivan-tkatchev

Description

@ivan-tkatchev
openapi-changes console ./old/openapi.yaml ./new/openapi.json

Pressing "enter" anywhere causes this crash:

@@@@@@@   @@@@@@@   @@@@@@   @@@@@@   @@@@@@@@
@@@@@@@@  @@@@@@@@  @@@@@@@  @@@@@@@  @@@@@@@@
@@!  @@@  @@!  @@@      @@@      @@@  @@!
!@!  @!@  !@   @!@      @!@      @!@  !@!
@!@@!@!   @!@!@!@   @!@!!@   @!@!!@   @!!!:!
!!@!!!    !!!@!!!!  !!@!@!   !!@!@!   !!!!!:
!!:       !!:  !!!      !!:      !!:  !!:
:!:       :!:  !:!      :!:      :!:  :!:
 ::        :: ::::  :: ::::  :: ::::   ::
 :        :: : ::    : : :    : : :    :


🔗 https://pb33f.io/openapi-changes/
------------------------------------
openapi-changes version: latest | compiled: Fri, 05 Dec 2025 11:24:21 MSK

2025-12-05 11:24:21 ERROR error building path item: array build failed, input is not an array, line 160, column 18                                                                   
  DONE   starting console...                                                                                                                                                         


panic: runtime error: slice bounds out of range [:14] with capacity 1 [recovered, repanicked]

goroutine 1 [running]:
github.com/rivo/tview.(*Application).Run.func1()
	github.com/rivo/tview@v0.0.0-20241227133733-17b7edb88c57/application.go:297 +0x4c
panic({0x8803a0?, 0x4000f1e000?})
	runtime/panic.go:783 +0x120
github.com/pb33f/openapi-changes/tui.RenderDiff(0x4000280300?, 0x4000280480, 0x400087d140, 0x400033c9a0)
	github.com/pb33f/openapi-changes/tui/diff_view.go:265 +0x47f0
github.com/pb33f/openapi-changes/tui.BuildApplication.func2(0x18?)
	github.com/pb33f/openapi-changes/tui/main_console.go:84 +0x44
github.com/rivo/tview.(*TreeView).InputHandler.func1.1(...)
	github.com/rivo/tview@v0.0.0-20241227133733-17b7edb88c57/treeview.go:806
github.com/rivo/tview.(*TreeView).InputHandler.func1(0x200000018?, 0x61e610?)
	github.com/rivo/tview@v0.0.0-20241227133733-17b7edb88c57/treeview.go:859 +0x8c
github.com/rivo/tview.(*TreeView).InputHandler.(*Box).WrapInputHandler.func2(0x4001187ea0?, 0x2c25c?)
	github.com/rivo/tview@v0.0.0-20241227133733-17b7edb88c57/box.go:167 +0x50
github.com/rivo/tview.(*Grid).InputHandler.func1(0x40001b20e0, 0x4001904010)
	github.com/rivo/tview@v0.0.0-20241227133733-17b7edb88c57/grid.go:664 +0x208
github.com/rivo/tview.(*Grid).InputHandler.(*Box).WrapInputHandler.func2(0x4000c4c5a0?, 0x4000fa36d8?)
	github.com/rivo/tview@v0.0.0-20241227133733-17b7edb88c57/box.go:167 +0x50
github.com/rivo/tview.(*Application).Run(0x4000ec60e0)
	github.com/rivo/tview@v0.0.0-20241227133733-17b7edb88c57/application.go:416 +0x7bc
github.com/pb33f/openapi-changes/cmd.runLeftRightCompare({0xffffef537620, 0x17}, {0xffffef537638, 0xb}, 0x40001c6310, 0x40001c6380, {0x0, 0x0}, 0x1, 0x0)
	github.com/pb33f/openapi-changes/cmd/console.go:397 +0x598
github.com/pb33f/openapi-changes/cmd.init.0.GetConsoleCommand.func1(0x400033e008, {0x40001b36a0, 0x2, 0x9443b1?})
	github.com/pb33f/openapi-changes/cmd/console.go:255 +0x790
github.com/spf13/cobra.(*Command).execute(0x400033e008, {0x40001b3620, 0x2, 0x2})
	github.com/spf13/cobra@v1.9.1/command.go:1015 +0x7d4
github.com/spf13/cobra.(*Command).ExecuteC(0x1516be0)
	github.com/spf13/cobra@v1.9.1/command.go:1148 +0x350
github.com/spf13/cobra.(*Command).Execute(...)
	github.com/spf13/cobra@v1.9.1/command.go:1071
github.com/pb33f/openapi-changes/cmd.Execute({0x9451d5?, 0x0?}, {0x9451d5?, 0x953ea8?}, {0x400002e800?, 0x40000021c0?})
	github.com/pb33f/openapi-changes/cmd/root.go:52 +0x8c
main.main()
	github.com/pb33f/openapi-changes/openapi-changes.go:29 +0x16c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions