-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trailing slash removed from root requests #101
Comments
This seems to be the commit that introduced the change: de2e648 however I dont see any specific test cases that relate to the root path. @casualjim @e-zhang - do you know what the expected behaviour is with the case above? Any issue with just removing the |
I think the original change was introduced in 20675b2 It looks like that change was for the case where Here's the difference in behavior from |
there is nothing in the spec that says a trailing / is significant. |
@casualjim unfortunately this is a third-party service, so we cant change their implementation. Like you say, its not clear from the spec how to deal with this case, so i'll probably open a ticket over there. I did find a workaround though, if you specify the endpoint like this: paths:
//:
get: then it resolves to the intended destination |
we could add a method to the runtime that allows you to hook into or augment the path normalization? |
Given the example swagger:
the following code in request.go doesnt create the correct path:
So in this example:
request.buildHTTP currently bins off the trailing slash to set the urlPath to: "/myservice" instead of the correct "/myservice/". Changing basePath to "/myservice/" doesnt make any difference.
Couple of options:
&& r.pathPattern != "/"
- not sure what this is trying to achieveThe text was updated successfully, but these errors were encountered: