Skip to content
Advertisement

Disable feign encoding of PathVariables

I have the following Feign Client:

JavaScript

The items can contains special characters like : or :: which are being encoded.

Request URL becomes something like:

  • https://myservice.com/item/a%3Ab%3A%3Ac

Rather than:

  • https://myservice.com/item/a:b::c

Can anyone help me understand how can we fix this issue?

Advertisement

Answer

OpenFeign has an issue tracking:

Guess it will be implemented by spring-cloud-feign once its done. Meanwhile, my workaround for this issue is to create a RequestInterceptor and replace %3A with :

JavaScript

And use this requestInterceptor to build your feignClient in the feignConfig:

JavaScript
Advertisement