-
Notifications
You must be signed in to change notification settings - Fork 70
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
fix path segment parsing when suffixed with query #689
Conversation
else if (str.startsWith("{") && str.endsWith("}")) | ||
Some(PathSegment.label(str.substring(1, str.length() - 1))) | ||
else Some(PathSegment.static(str)) | ||
Option(str).map { str => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you got rid of a .isEmpty()
here
you may want to reintroduce it as a .filter(_.nonEmpty)
on the Option
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah yes , was thinking of Null , will update
PathSegment implementation returns just the path, minus any query parameters A staticQueryParams method has been added HttpEndpoint, the Http4s client calls that method to retrieve any static query params and pass them on Tests: metadata.smithy has been modified and PathSpec includes tests for testing the HttpEndpoint functionality
val uri = baseUri | ||
.copy(path = baseUri.path.addSegments(path.map(Uri.Path.Segment(_)))) | ||
.withQueryParams(staticQueries) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff !
In the scenario of a constant query (and perhaps some other cases) parsing of path segments fail.
http://yourhost/my/uri/{foo}?hello=world
should parse a label foo, which it currently does not