package main
import (
"github.com/cro4k/doc/docer""github.com/gin-gonic/gin""example/annotation"
)
typeRequeststruct {
Namestring`json:"name" doc:"must"`
}
typeResponsestruct {
Messagestring`json:"message"`
}
// SayHello// there is no need to specify url path or http method for a controller, // docer will decode them automatically from the gin.Engine.// @comment SayHello controller// @req [Request]// @rsp [Response]funcSayHello(c*gin.Context) {
}
funcmain() {
e:=gin.Default()
e.POST("/hello", SayHello)
// annotation.Elements are auto generated by 'ann build' command// before run 'ann build', you should install https://github.com/cro4k/annotation firstdocer.Init(annotation.Elements)
documents:=docer.Decode(e)
//TODO export documents
}