A small demo project showing how to use go tool and generate Go code from an OpenAPI spec.
This repository demonstrates generating API types from an OpenAPI spec and a few useful go tool commands you can run against the built binary.
Prerequisites
- Go 1.25.x (see
go.mod) - Make (optional, used by the included Makefile)
Files of interest
misc/openapi.yml— OpenAPI spec used to generate API types.misc/oapi-config.yml— configuration for the oapi-codegen tool.cmd/service/api/generate.go— contains the//go:generatedirective.Makefile— helper targets:install-deps,generate.