Closed podhmo closed 1 year ago
package main import ( "github.com/getkin/kin-openapi/openapi3" reflectopenapi "github.com/podhmo/reflect-openapi" ) type Foo struct { Name string `json:"name"` } func GetFoo() *Foo { return nil } func main() { c := &reflectopenapi.Config{} c.EmitDoc(func(m *reflectopenapi.Manager) { m.RegisterFunc(GetFoo).After(func(op *openapi3.Operation) { op.OperationID = "Foo" // main.GetFoo -> Foo m.Doc.AddOperation("/foo", "GET", op) }) }) }