Golang Swagger2.0

This post is currently in progress. You shall not pass. 🧙🏻‍♂️

This post serve as small documentation to add swagger and its ui to your existing golang API. I will be using go swagger 2.0 library or framework to do so which basically add comments on your existing code to generate swagger documentation.

  • Make a small gorilla mux api two endpoints with GET and POST
  • Add the comments annotations to source code, meaning handlers
  • Download swagger-ui from the go-swagger repo
  • Serve the swagger-ui folder as a fileserver.
  • Embed the swagger-ui inside output binary
  • Deploy this small api server to GCP
  • Host on AWS
  • Maybe deploy it using kubernetes
comments powered by Disqus