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

Multiple APIs with same base URL prevents any interaction with api subcommand #262

Open
logicbomb421 opened this issue Aug 22, 2024 · 0 comments

Comments

@logicbomb421
Copy link

I accidentally created an API with the same base URL as another via the interactive restish api configure and afterwards I cannot interact with restish api in any way due to the following panic:

panic: multiple APIs configured with the same base URL: <BASE URL VALUE>

goroutine 1 [running]:
github.com/danielgtaylor/restish/cli.initAPIConfig.func6(0x1400083fbf0?, 0x1400083fb90, 0x1400007c3c0)
	/home/runner/work/restish/restish/cli/apiconfig.go:245 +0x204
github.com/danielgtaylor/restish/cli.initAPIConfig()
	/home/runner/work/restish/restish/cli/apiconfig.go:261 +0x960
github.com/danielgtaylor/restish/cli.Init({0x103094b9b, 0x7}, {0x10334a270, 0x6})
	/home/runner/work/restish/restish/cli/cli.go:571 +0x1f68
main.main()
	/home/runner/work/restish/restish/main.go:25 +0x1b8

I was able to fix this by manually editing the JSON file after digging it up, however it would be helpful if at least the api edit command could open an invalid config to make fixing this easier. Alternatively, api configure could check to see if the base URL entered is a duplicate and refuse to write.

Please let me know if more info is needed.

Thanks!


restish version 0.20.0

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

No branches or pull requests

1 participant