@@ -23,11 +23,12 @@ GOLANGCI := $(GOBIN_DIR)/golangci-lint
2323GOFUMPT := $(GOBIN_DIR ) /gofumpt
2424GOIMPORTS := $(GOBIN_DIR ) /goimports
2525GOVULNCHECK := $(GOBIN_DIR ) /govulncheck
26+ OAPICODEGEN := $(GOBIN_DIR ) /oapi-codegen
2627
2728# ---------------------------------------------------------------------------
2829# Phony declarations (alphabetical).
2930# ---------------------------------------------------------------------------
30- .PHONY : all bench boundary-guard build ci clean cover fmt help lint lint-fix \
31+ .PHONY : all bench boundary-guard build ci clean cover fmt gen help lint lint-fix \
3132 security test test-10x test-race tidy version vet
3233
3334# ---------------------------------------------------------------------------
@@ -96,7 +97,7 @@ tidy: ## Tidy go.mod / go.sum.
9697# ---------------------------------------------------------------------------
9798# Composite gate used by CI and pre-push.
9899# ---------------------------------------------------------------------------
99- ci : tidy fmt vet boundary-guard lint test-race security # # Run everything CI runs.
100+ ci : tidy gen fmt vet boundary-guard lint test-race security # # Run everything CI runs.
100101 @echo " All CI checks passed."
101102
102103# ---------------------------------------------------------------------------
@@ -107,6 +108,10 @@ version: ## Print the version that will be embedded.
107108 @echo " Commit: $( COMMIT) "
108109 @echo " Date: $( DATE) "
109110
111+ gen : # # Generate code from the OpenAPI spec (requires oapi-codegen).
112+ go generate ./internal/spec/
113+ @echo " Code generation complete."
114+
110115clean : # # Remove build artefacts.
111116 rm -rf coverage.out coverage.html
112117 go clean -testcache
0 commit comments