swaggo / gin-swagger

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

swaggo/files 2.0 not supported? #264

Open PatrickRice-KSC opened 1 year ago

PatrickRice-KSC commented 1 year ago

I'm trying to update to use the newest version of swaggo files (2.0), released 2 weeks ago. In that version, I see the Handler function was removed, and now the underlying files package simple exposes an embedded file system.

So I updated my router to use StaticFS to host that file system instead of registering a GET handler, but that simply hosts a PetStore swagger UI instead.

How should we use the file system reference to ensure that the correct swagger UI is hosted?

ubogdan commented 1 year ago

@PatrickRice-KSC For the moment there is no way to use files (v2) with gin-swagger at this time. The change is a breaking one and a v2 of gin-swagger needs to be created.

PatrickRice-KSC commented 1 year ago

@ubogdan gotcha, thanks! I'll watch for the new version :)

nyetwurk commented 3 months ago

This is affecting us as well now.