diff --git a/multi/multi_spring-cloud-feign.html b/multi/multi_spring-cloud-feign.html index fa5d290c..8461e5f3 100644 --- a/multi/multi_spring-cloud-feign.html +++ b/multi/multi_spring-cloud-feign.html @@ -189,25 +189,18 @@ feign.compression.request.min-request-size=2048 Logger.Level feignLoggerLevel() { return Logger.Level.FULL; } -} +}
The OpenFeign @QueryMap annotation provides support for POJOs to be used as
+GET parameter maps. Unfortunately, the default OpenFeign QueryMap annotation is
+incompatible with Spring because it lacks a value property.
Spring Cloud OpenFeign provides an equivalent @SpringQueryMap annotation, which
+is used to annotate a POJO or Map parameter as a query parameter map.
For example, the Params class defines parameters param1 and param2:
// Params.java +public class Params { + private String param1; + private String param2; -=== Feign `@QueryMap` support + // [Getters and setters omitted for brevity] +}
The following feign client uses the Params class by using the @SpringQueryMap annotation:
@FeignClient("demo") +public class DemoTemplate { -The OpenFeign `@QueryMap` annotation provides support for POJOs to be used as -GET parameter maps. Unfortunately, the default OpenFeign QueryMap annotation is -incompatible with Spring because it lacks a `value` property. - -Spring Cloud OpenFeign provides an equivalent `@SpringQueryMap` annotation, which -is used to annotate a POJO or Map parameter as a query parameter map. - -For example, the `Params` class defines parameters `param1` and `param2`: - -[source,java,indent=0]
public class Params { - private String param1; - private String param2;
// [Getters and setters omitted for brevity] -}
The following feign client uses the `Params` class by using the `@SpringQueryMap` annotation: - -[source,java,indent=0]
@FeignClient("demo") -public class DemoTemplate {
@GetMapping(path = "/demo") - String demoEndpoint(@SpringQueryMap Params params); -}