OpenAPI Generator for Go

GitHub go.mod Go version GitHub commit activity GitHub last commit GitHub contributors GitHub License https://raw.githubusercontent.com/goppuchino/oag/master/assets/oag.png

A fast and lightweight tool to generate clean, standards-compliant OpenAPI 3 specifications directly from your Go code. Perfect for:

  • Auto-documenting REST APIs 🏗️

  • Eliminating manual spec maintenance ✨

  • Ensuring compatibility with Swagger UI, Postman & more 🔌

Features:
✅ Struct-to-Schema auto-mapping
✅ Built-in validation & linting
✅ Custom template support
1// Just annotate & generate!
2// @method get
3// @path /users/{id}
4// @summary Get user
5// @description Get user information
6// @param id path isRequired User ID for get user information
7func GetUser(w http.ResponseWriter, r *http.Request) { ... }

Get started:

$ go install github.com/goppuchino/oag
$ cd <Your Project>
$ oag

Because nobody loves writing YAML by hand. 🐹