Jaycean commented on a change in pull request #1673: URL: https://github.com/apache/apisix-dashboard/pull/1673#discussion_r602740981
########## File path: api/internal/handler/data_loader/route_export.go ########## @@ -245,8 +246,14 @@ func (h *Handler) RouteToOpenAPI3(c droplet.Context, routes []*entity.Route) (*o path.RequestBody = &openapi3.RequestBodyRef{Value: requestBody} path.Responses = openapi3.NewResponses() - for i := range route.Methods { - switch strings.ToUpper(route.Methods[i]) { + if route.Methods != nil && len(route.Methods) > 0 { + routeMethods = route.Methods + } else { + routeMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete, http.MethodPatch, http.MethodHead, http.MethodConnect, http.MethodTrace, http.MethodOptions} Review comment: Yeah,Because these methods such as "GET", "POST" and so on are immutable, the use here is more uniform, and "Get", "get" and "GET" will not appear. They don't affect the output. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org