kevinw66 commented on a change in pull request #2330:
URL: https://github.com/apache/apisix-dashboard/pull/2330#discussion_r820166927



##########
File path: api/internal/handler/data_loader/route_import.go
##########
@@ -137,6 +137,22 @@ func (h *ImportHandler) Import(c droplet.Context) 
(interface{}, error) {
                }
        }
 
+       // merge route
+       idRoute := make(map[string]*entity.Route)
+       for _, route := range routes {
+               if existRoute, ok := idRoute[route.RouteId]; ok {
+                       uris := append(existRoute.Uris, route.Uris...)
+                       existRoute.Uris = uris
+               } else {
+                       idRoute[route.RouteId] = route

Review comment:
       `methods` may already merged by `OpenAPI3ToRoute` method via path, and 
route have different path become different routes.
   Here I just merge path via original route id.




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to