zaghaghi / openapi-tui

Terminal UI to list, browse and run APIs defined with openapi spec.
MIT License
659 stars 15 forks source link

Crashes on SysML-v2 API #32

Closed wucke13 closed 3 months ago

wucke13 commented 3 months ago

The following openapi document crashes openapi-tui: https://www.omg.org/spec/SysML/20230201/SysML.json

name = "openapi-tui"
operating_system = "NixOS 24.5.0 [64-bit]"
crate_version = "0.5.0"
explanation = """
Panic occurred in file 'src/panes/request.rs' at line 114
"""
cause = "called `Result::unwrap()` on an `Err` value: Ref"
method = "Panic"
backtrace = """

   0: 0x55d325693b63 - core::result::unwrap_failed::h850510ea6c159887
   1: 0x55d3256f8581 - openapi_tui::panes::request::RequestPane::init_schema::h804134173614012b
   2: 0x55d325709203 - <openapi_tui::pages::home::Home as openapi_tui::pages::Page>::init::h3ca7a0cb0cf92212
   3: 0x55d32570fa4d - tokio::runtime::park::CachedParkThread::block_on::h512d28b19a6191c2
   4: 0x55d3257357fa - tokio::runtime::context::runtime::enter_runtime::h8e4757cddb1e3c36
   5: 0x55d325704a2c - tokio::runtime::runtime::Runtime::block_on::h1efad34548a81410
   6: 0x55d325736f3a - openapi_tui::main::h571c0587b8f27f15
   7: 0x55d32570cfc3 - std::sys_common::backtrace::__rust_begin_short_backtrace::hcb41057ce7df048c
   8: 0x55d32570cfdd - std::rt::lang_start::{{closure}}::h30e96164209c2202
   9: 0x55d325a44184 - std::panicking::try::ha86251cf5daa9bea
  10: 0x55d325a337bb - std::rt::lang_start_internal::ha6a51778162f8d22
  11: 0x55d325737015 - main
  12: 0x7fd4dfe2210e - __libc_start_call_main
  13: 0x7fd4dfe221c9 - __libc_start_main@@GLIBC_2.34
  14: 0x55d325693f35 - _start
  15:        0x0 - <unresolved>"""
Well, this is embarrassing.

openapi-tui had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/run/user/138528/report-3c1df68c-27e9-44b1-b046-93960b053c57.toml". Submit an issue or email with the subject of "openapi-tui Crash Report" and include the report as an attachment.

- Homepage: https://github.com/zaghaghi/openapi-tui
- Authors: Hamed Zaghaghi <hamed.zaghaghi@gmail.com>

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Ref
Location: src/panes/request.rs:114

This is a bug. Consider reporting it at https://github.com/zaghaghi/openapi-tui

[nix-shell:~/documents/projects/sysml-v2-sql]$ RUST_BACKTRACE=full openapi-tui --openapi-path ad-23-02-24.json
Well, this is embarrassing.

openapi-tui had a problem and crashed. To help us diagnose the problem you can send us a crash report.

We have generated a report file at "/run/user/138528/report-87ea2583-35b6-4580-bae7-ca1dffccefbe.toml". Submit an issue or email with the subject of "openapi-tui Crash Report" and include the report as an attachment.

- Homepage: https://github.com/zaghaghi/openapi-tui
- Authors: Hamed Zaghaghi <hamed.zaghaghi@gmail.com>

We take privacy seriously, and do not perform any automated error collection. In order to improve the software, we rely on people to submit reports.

Thank you kindly!
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Ref
Location: src/panes/request.rs:114

This is a bug. Consider reporting it at https://github.com/zaghaghi/openapi-tui

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮
   9: openapi_tui::panes::request::RequestPane::init_schema::h804134173614012b
      at <unknown source file>:<unknown line>
  10: <openapi_tui::pages::home::Home as openapi_tui::pages::Page>::init::h3ca7a0cb0cf92212
      at <unknown source file>:<unknown line>
  11: tokio::runtime::park::CachedParkThread::block_on::h512d28b19a6191c2
      at <unknown source file>:<unknown line>
  12: tokio::runtime::context::runtime::enter_runtime::h8e4757cddb1e3c36
      at <unknown source file>:<unknown line>
  13: tokio::runtime::runtime::Runtime::block_on::h1efad34548a81410
      at <unknown source file>:<unknown line>
  14: openapi_tui::main::h571c0587b8f27f15
      at <unknown source file>:<unknown line>
  15: std::sys_common::backtrace::__rust_begin_short_backtrace::hcb41057ce7df048c
      at <unknown source file>:<unknown line>
  16: std::rt::lang_start::{{closure}}::h30e96164209c2202
      at <unknown source file>:<unknown line>
  17: std::panicking::try::ha86251cf5daa9bea
      at <unknown source file>:<unknown line>
  18: std::rt::lang_start_internal::ha6a51778162f8d22
      at <unknown source file>:<unknown line>
  19: main<unknown>
      at <unknown source file>:<unknown line>
  20: __libc_start_call_main<unknown>
      at <unknown source file>:<unknown line>
  21: __libc_start_main@@GLIBC_2.34<unknown>
      at <unknown source file>:<unknown line>
  22: _start<unknown>
      at <unknown source file>:<unknown line> 
zaghaghi commented 3 months ago

Hi @wucke13,

I just noticed that you are using an older version of openapi-tui,

crate_version = "0.5.0"

Please upgrade to the latest version that do not have this bug in it. If you're using Nix, @linuxmobile or @KiaraGrouwstra could help you with this.

Also note that the json url you mentioned is not an openapi json, and I believe it's not going to work with openapi-tui unless you change it to openapi. Here you can find the openapi specification

I'll close this issue for now, feel free to open it once again if I assumed something wrong.