You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an obvious situation where there is either a bug (the trailing slash should not be removed), or there is something opinionated going on (e.g. HATEOAS links should never end in /).
If not a bug, then a developers code is always going to break and then have messy workarounds, therefore Spring HATEOAS should be clear.
I suggest that if this is the case, then it would make most sense to throw IllegalArgumentException with an appropriate comment that the trailing slash should be removed (this is safe because the endpoint will still be resolved correctly if a trailing slash is added to a request - but not the reverse)
The text was updated successfully, but these errors were encountered:
odrotbohm
changed the title
Endpoint with trailing slash should be preserved or else throw IllegalArgumentException in linkTo(methodOn(..))
AnnotationMappingDiscoverer does not preserve trailing mapping slashes
Feb 16, 2021
In #269 the following problem is raised and never resolved:
Using
linkTo(methodOn())
to reference an endpoint with a trailing slash removes the trailing slash.result: http://localhost:6010/api/myentities
This is an obvious situation where there is either a bug (the trailing slash should not be removed), or there is something opinionated going on (e.g. HATEOAS links should never end in /).
If not a bug, then a developers code is always going to break and then have messy workarounds, therefore Spring HATEOAS should be clear.
I suggest that if this is the case, then it would make most sense to throw
IllegalArgumentException
with an appropriate comment that the trailing slash should be removed (this is safe because the endpoint will still be resolved correctly if a trailing slash is added to a request - but not the reverse)The text was updated successfully, but these errors were encountered: