-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Hello question (could not label the issue),
My goal is to get the url template without the host and port.
Given: https://{{host}}:{{port}}/v1/api/resource/{id}}
Wanted: /v1/api/resource/{id}
Today, this can be achieved by calling methodMetadata. However, it is annotated with Experimental
@Experimental public RequestTemplate methodMetadata(MethodMetadata methodMetadata) { this.methodMetadata = methodMetadata; return this; }
I am using it, in production code, as follow:
templatedRouted = request.requestTemplate().methodMetadata().template().path();
--
First things first, I would have preferred to use requestTemplate.uriTemplate() but uriTemplate field is not exposed as of today. Moreover requestTemplate.url() appends the path (https://github.com/OpenFeign/feign/blob/master/core/src/main/java/feign/RequestTemplate.java#L546).
Is it safe to use methodMetadata()? Have you gathered enough data to make a decision? Finally, should I check against nil?
Thanks!