TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Automatically generate swagger files from Golang fiber code

1 pointsby TDiblik3 months ago

1 comment

TDiblik3 months ago
Hey, I would like to get some feedback on the library I&#x27;m developing for fiber v3. It basically automatically generates swagger.yaml + swagger.json + swagger editor ui from your fiber routes.<p>It can automatically generate the route + the route path parameters. If you wanna provide more info, I&#x27;ve created a simple interface that wraps the fiber&#x27;s router and isn&#x27;t too annoying ... or you can use `gofiberswagger.RegisterRoute()` to add the definition on your own (without touching the existing code).<p>The library uses reexported github.com&#x2F;getkin&#x2F;kin-openapi types, that means that you can specify ANY openapi field you wanna (not only in routes, but also in the general config, eg. auth &#x2F; security schemes &#x2F; title &#x2F; openapi version &#x2F; etc).<p>I&#x27;ve implemented it into some of my personal projects and tbh I love it, that&#x27;s why I decided to share it with y&#x27;all. I know about swaggo&#x2F;swag, however I don&#x27;t like how my code looks while using it.<p>I&#x27;ve created some basic examples inside the `&#x2F;examples&#x2F;` folder, so be sure to check them out! Any feedback would be appreciated.