Sending api requests via swagger.json suddenly results in error 404

 

I have a rest api based on “github.com/julienschmidt/httprouter”, which is working fine if I use curl (or the browser or the working env). Then I have had the idea to document the rest api by using swaggo - which was working fine for some days. 
After any change of the API I run `swag init -g routes.go` and it was creating the go, yaml and json file. 
The json or yaml file was loaded by the Goland and I could use the try button to test the api endpoints.

But now suddenly this is not working anymore (w/o general changes that I'm aware of). 
No matter which endpoint I try I always get the error 404:

If I use the generated curl command, the request is always answered w/o any issue:

[test ~]$ curl -X 'GET'   'http://127.0.0.1:8080/api/v1/xcross-sv/health'
{"message":"Running"}

 

Does anybody have any idea what the issue may be???
Thanks in advance!

BR Kai

0
1 comment

I found the solution for the issue by myself!
Deleting the Goland cache with the following cmd:

rm -rf ~/.cache/JetBrains/GoLand2025.1/*
rm -rf ~/.local/share/JetBrains/GoLand2025.1/caches/*

was solving the issue…

0

Please sign in to leave a comment.