Hi, there can more than one reason why you face this error. it can be about: It can be missing or incorrect Swagger annotations on the API endpoints. or Swagger file not generated properly. or Swagger can't find the spec file. You can check these and if these doesn't work, check out the codebase from my GitHub and compare with yours. these are the solutions that come to my mind, hope you can resolve it
Hi, Swagger is a static ui actually, and I think setting the route with a variable make the api non-consistent, so I think you can't do that. If you are talking for getting id or something like that, then yes, you can. example: // @Router /orders/{id} [get] app.Get("/orders/:id", func(ctx *fiber.App)... hope I understand it correctly, if not, we can discuss further. thanks
Hi, for Swaggo library, you need to specify for each endpoint. I think there was a library that can do that but it had a cons. I researched it but couldn't find the library :( If I can find it, I will reply to here again
hi, I don't know the error you face but maybe you can access the code from my GitHub, and start the edit code from there. and sorry for the late response
Hocam o tatli aksaninizdan direkt Turk oldugunuzu anladim :D
Harika bir video olmus direkt kanali takibe aldim.
Cok tesekkurler
ben teşekkür ederim, aksanım direkt belli oluyor evet :D
Amazing video man, It's very helpful to me : )
thanks :)
I've followed each step, but I am getting this error in Swagger dashboard:
No operations defined in spec!
Hi, there can more than one reason why you face this error. it can be about:
It can be missing or incorrect Swagger annotations on the API endpoints. or Swagger file not generated properly. or Swagger can't find the spec file. You can check these and if these doesn't work, check out the codebase from my GitHub and compare with yours.
these are the solutions that come to my mind, hope you can resolve it
Is there any way to provide route path in @Router as a variable ?
Hi, Swagger is a static ui actually, and I think setting the route with a variable make the api non-consistent, so I think you can't do that.
If you are talking for getting id or something like that, then yes, you can.
example:
// @Router /orders/{id} [get]
app.Get("/orders/:id", func(ctx *fiber.App)...
hope I understand it correctly, if not, we can discuss further.
thanks
Awesome video, can we auto generate without putting the swagger in each endpoint
Hi, for Swaggo library, you need to specify for each endpoint. I think there was a library that can do that but it had a cons. I researched it but couldn't find the library :( If I can find it, I will reply to here again
Is there a way to change the swagger icon?
hi @verdisasmeka8114 I have looked at the documentation but couldn't find a way :/ sorry.
I used try along your way but it cannot set many examples
hi, I don't know the error you face but maybe you can access the code from my GitHub, and start the edit code from there.
and sorry for the late response
wow good bro.
thanks :)