Open dschulten opened 3 years ago
The reason that the keys are encoded are the @Path
annotations on the methods in KeyValueClient.Api
. Their encoded
property is false
, which causes RequestFactory
to create a ParameterHandler.Path
that encodes the entire key. Probably the Api Methods need a variant with a {path}
and a {key}
argument where the path is encoded, but not the key - the question is if that could work alongside the existing Api
.
Consul allows to organize keyValues in folders, which then become part of the URL path.
In the example kv url below, resources/ is a kv folder and
my.key
is an actual keyValue pair.http://consul.example.com/v1/kv/resources/my.key
Unfortunately
KeyValueClient.getValue()
urlencodes a key with folder prefix such as resources/my.key and requests/v1/kv/resources%2fmy.key
which fails with 404.
The same problem occurs with
KeyValueClient.getValues()
for a path of folders, as ingetValues("resources/subfolder")
.