swaggo / gin-swagger

gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
3.76k stars 270 forks source link

Can't use multiple API functions #223

Open sxwebdev opened 2 years ago

sxwebdev commented 2 years ago

I'm trying to use multiple api instances but only the last instance works.

When the application starts, I go to the public api and everything works. Then I go to the private api and everything opens too.

If you open the public api again, then there will already be an error. Private api still works correctly

v1.GET("/swagger/public/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.InstanceName("public")))
v1.GET("/swagger/private/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, ginSwagger.InstanceName("private")))
ubogdan commented 2 years ago

@sxwebdev Thanks for letting us know. We are aware of this issue https://github.com/swaggo/gin-swagger/issues/197.