-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
This API is inconsistent with the rest of the API:
if err := r.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
pathTemplate, err1 := route.GetPathTemplate()
var queries, err2 = route.GetQueriesRegexp()
if err1 == nil && err2 == nil {
var methods, _ = route.GetMethods()
for _, m := range methods {
fmt.Println("ROUTE:", pathTemplate, route.GetName(), m, queries)
}
}
return nil
}); err != nil {
vibelog.Stdout.Error(err)
os.Exit(1)
}
the problem is if we do this:
r.Methods("POST").Path("/v1/conversations").Queries("AAA","BBB").HandlerFunc(
mw.Middleware(
createNewChatConversation(c),
),
)
r.Methods("GET").Path("/v1/conversations").Queries("THIS IS NOT","THE SAME QUERIES").HandlerFunc(
mw.Middleware(
doSomethingElse(c),
),
)
for the same route, for different methods, there are DIFFERENT Queries attached, but with route.GetQueries, it is just returning one object when it should return different objects for different methods.
Right?
Expected Behavior
Different Queries returned for different methods for the same Path
Steps To Reproduce
No response
Anything else?
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status