The spring-cloud-start-feign:1.2.2 realease version is used here, and the dependency manager version is CAMDEN.SR2
The reason for the error is that when the value of @requestparam is empty, the parameter is treated as a map
Org.springframework.cloud.netflix.feign.annotation.RequestParamParameterProcessor
The code is as follows:
@Overridepublic boolean processargument (Annotatedparametercontext context,annotation Annotation) {Requestparam Requestparam = Annotation.cast (ANNOTATION); String name = Requestparam.value (); if (emptytonull (name) = null) {context.setparametername (name); Methodmetadata data = Context.getmethodmetadata (); collection<string> query = Context.settemplateparameter (Name,data.template (). queries (). Get (name)); Data.template (). Query (name, query);} else {//supports ' MAP ' typesmethodmetadata data = Context.getmethodmetadata ();d Ata.querymapindex ( Context.getparameterindex ());} return true;}
Note that spring-cloud-feign handles @requestparam and spring MVC differently, and spring MVC reflects the name of the parameter as value when the value of @requestparam is empty.
Solution: Add value to @requestparam
Spring-cloud-feign using @requetparam error querymap parameter must be a map:class java.lang.String