go-forge/cmd/forgegen/main.go
Virgil 551a964fdb
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m36s
refactor(ax): enforce v0.8.0 polish rules
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:39:24 +00:00

28 lines
663 B
Go

package main
import (
"flag"
core "dappco.re/go/core"
)
func main() {
specPath := flag.String("spec", "testdata/swagger.v1.json", "path to swagger.v1.json")
outDir := flag.String("out", "types", "output directory for generated types")
flag.Parse()
spec, err := LoadSpec(*specPath)
if err != nil {
panic(core.E("forgegen.main", "load spec", err))
}
types := ExtractTypes(spec)
pairs := DetectCRUDPairs(spec)
core.Print(nil, "Loaded %d types, %d CRUD pairs", len(types), len(pairs))
core.Print(nil, "Output dir: %s", *outDir)
if err := Generate(types, pairs, *outDir); err != nil {
panic(core.E("forgegen.main", "generate types", err))
}
}