Closed spring-projects-issues closed 7 years ago
Oliver Drotbohm commented
Yes, the reason is that slash(…)
can also take segments that contain request parameters (e.g. foo?bar=foobar
). It looks like there's no real alternative to using fromUriString(…)
as there's no factory method that allows parsing request parameters except that one. Rossen Stoyanchev, can you advise?
Oliver Drotbohm commented
It looks like the test passes if I prepend the input value with a /
. That apparently triggers the regex to match in the expected way. I've [filed and fixed a ticket|{https://github.com/spring-projects/spring-hateoas/issues/582] in Spring HATEOAS to tweak LinkBuilderSupport
accordingly.
Oliver Drotbohm commented
Closing as invalid, as the root cause has been fixed in Spring HATEOAS
Thomas Prebble opened DATAREST-1074 and commented
When the self ref is being generated for an entity with an id containing colons (e.g. SDN:P02::ASAM), the id is not appended to the entities base url
Example - option Entity containing ID SDN:P02::ASAM
Expected self ref http://\:\/option/SDN:P02::ASAM
Actual self ref
http://\:\/option
self ref for an id with no colons http://\:\/option/SDNP02ASAM
Initial Analysis
Caused by UriComponentsBuilder.fromUriString(path) in LinkBuilderSupport. When the RepositoryLinkBuilder delegates the slash method call to its parent, LinkBuilderSupport calls UriComponentsBuilder.fromUriString. the URI_PATTERN matches everything before the first colon to the scheme and the remaining section to ssp. The below test recreates the issue within the UriComponentsBuilder. Is there a reason the slash method calls fromUriString instead of fromPath?
No further details from DATAREST-1074