From 8794cce438e946d268d73c5dcd74a293c9ffce86 Mon Sep 17 00:00:00 2001 From: Daniel Tang Date: Fri, 16 Feb 2018 11:37:40 -0800 Subject: [PATCH] move parameterOrder order declaration closer to use --- .../com/google/api/server/spi/discovery/DiscoveryGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endpoints-framework/src/main/java/com/google/api/server/spi/discovery/DiscoveryGenerator.java b/endpoints-framework/src/main/java/com/google/api/server/spi/discovery/DiscoveryGenerator.java index e9d21d70..c2b5f40d 100644 --- a/endpoints-framework/src/main/java/com/google/api/server/spi/discovery/DiscoveryGenerator.java +++ b/endpoints-framework/src/main/java/com/google/api/server/spi/discovery/DiscoveryGenerator.java @@ -222,7 +222,6 @@ private void writeApiMethod(ApiConfig config, String servicePath, RestDescriptio private List computeParameterOrder(ApiMethodConfig methodConfig) { ImmutableSortedSet.Builder queryParamBuilder = ImmutableSortedSet.naturalOrder(); Collection pathParameters = methodConfig.getPathParameters(); - List order = new ArrayList<>(pathParameters); for (ApiParameterConfig parameterConfig : methodConfig.getParameterConfigs()) { if (parameterConfig.getClassification() == Classification.API_PARAMETER && !pathParameters.contains(parameterConfig.getName()) @@ -230,6 +229,7 @@ private List computeParameterOrder(ApiMethodConfig methodConfig) { queryParamBuilder.add(parameterConfig.getName()); } } + List order = new ArrayList<>(pathParameters); order.addAll(queryParamBuilder.build()); return order; }