Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(openapi): don't panic on requestBody content mime without schema #797

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

rinor
Copy link
Contributor

@rinor rinor commented Aug 14, 2024

Panics in cases like:

      requestBody:
        required: true
        content:
          application/json: {}
  • gptscript --list-tools https://raw.githubusercontent.com/cloudflare/api-schemas/main/openapi.yaml
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0x9d209e]

goroutine 1 [running]:
github.com/gptscript-ai/gptscript/pkg/loader.getOpenAPITools(0xc0000e1ef0, {0xc0001900a0, 0x4a}, {0xc0001900a0, 0x4a}, {0x0, 0x0})
	github.com/gptscript-ai/gptscript/pkg/loader/openapi.go:212 +0x2b7e
...

@g-linville
Copy link
Member

Thanks for finding this, @rinor !

@g-linville g-linville merged commit 91a5df6 into gptscript-ai:main Aug 15, 2024
10 checks passed
@rinor rinor deleted the fix/loader_openapi_panic branch August 15, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants