diff --git a/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java b/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java index fd68bb11b..1132baba3 100644 --- a/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java +++ b/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java @@ -50,8 +50,7 @@ public class GatewayProperties { * List of Routes. */ @NotNull - @Valid - private List routes = new ArrayList<>(); + private List<@Valid RouteDefinition> routes = new ArrayList<>(); /** * List of filter definitions that are applied to every route. diff --git a/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/route/RouteDefinition.java b/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/route/RouteDefinition.java index 58a6c0401..a9220d560 100644 --- a/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/route/RouteDefinition.java +++ b/spring-cloud-gateway-server-webflux/src/main/java/org/springframework/cloud/gateway/route/RouteDefinition.java @@ -43,11 +43,9 @@ public class RouteDefinition { private @Nullable String id; @NotEmpty - @Valid - private List predicates = new ArrayList<>(); + private List<@Valid PredicateDefinition> predicates = new ArrayList<>(); - @Valid - private List filters = new ArrayList<>(); + private List<@Valid FilterDefinition> filters = new ArrayList<>(); private @Nullable URI uri; diff --git a/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcProperties.java b/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcProperties.java index 6004166f4..cdca66430 100644 --- a/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcProperties.java +++ b/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcProperties.java @@ -41,15 +41,13 @@ public class GatewayMvcProperties { * List of Routes. */ @NotNull - @Valid - private List routes = new ArrayList<>(); + private List<@Valid RouteProperties> routes = new ArrayList<>(); /** * Map of Routes. */ @NotNull - @Valid - private LinkedHashMap routesMap = new LinkedHashMap<>(); + private LinkedHashMap routesMap = new LinkedHashMap<>(); /** * Mime-types that are streaming. diff --git a/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/RouteProperties.java b/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/RouteProperties.java index a2157cf54..6309f1ef2 100644 --- a/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/RouteProperties.java +++ b/spring-cloud-gateway-server-webmvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/RouteProperties.java @@ -48,14 +48,12 @@ public class RouteProperties { * List of predicates for matching the Route. */ @NotEmpty - @Valid - private List predicates = new ArrayList<>(); + private List<@Valid PredicateProperties> predicates = new ArrayList<>(); /** * List of filters to be applied to the Route. */ - @Valid - private List filters = new ArrayList<>(); + private List<@Valid FilterProperties> filters = new ArrayList<>(); /** * The destination URI.