Skip to content

Commit

Permalink
openapi
Browse files Browse the repository at this point in the history
  • Loading branch information
Artanis-c committed Jan 19, 2024
1 parent cebeab6 commit 173ec17
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions web/endpoints/swagger.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@ func UseSwaggerUI(router router.IRouterBuilder) {
xlog.GetXLogger("Endpoint").Debug("loaded swagger ui endpoint.")

router.GET("/swagger.json", func(ctx *context.HttpContext) {
routeInfoArr := router.GetRouteInfo()
builder := router.GetMvcBuilder()
fmt.Println(builder)
for _, routeInfo := range routeInfoArr {
fmt.Println(routeInfo)
}

con := builder.GetControllerDescriptorByName("usercontroller")
action, _ := con.GetActionDescriptorByName("register")
info := action.MethodInfo.Parameters[2]
fmt.Println(info.ParameterType.Field(2).Tag.Get("json"))
swaggerJson := `{
"swagger": "2.0",
"info": {
Expand Down

0 comments on commit 173ec17

Please sign in to comment.