Affects: 6.0.1


Using the WebClient in SpringWeb v6.0.1 to add a path segment via the path() method does not add the required / in front of the segment.

Here's a short code example:

...
uriBuilder
    .path("some/large/path")
    .path("1234")
...

Instead, we are forced to either append / to the second method invocation for path() or use the pathSegment() method like so:

...
uriBuilder
    .path("some/large/path")
    .path("/" + "1234")
...
uriBuilder
    .path("some/large/path")
    .pathSegment("1234")
...

Comment From: sbrannen

That's correct, and that's the documented behavior.

The Javadoc for org.springframework.web.util.UriBuilder.path(String) explicitly states:

The given value is appended as-is to previous path values without inserting any additional slashes. ... By contrast pathSegment does insert slashes between individual path segments.

In light of that, I am closing this issue.