Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
move parameterOrder order declaration closer to use
Browse files Browse the repository at this point in the history
  • Loading branch information
tangiel committed Feb 16, 2018
1 parent b09cd32 commit 8794cce
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ private void writeApiMethod(ApiConfig config, String servicePath, RestDescriptio
private List<String> computeParameterOrder(ApiMethodConfig methodConfig) {
ImmutableSortedSet.Builder<String> queryParamBuilder = ImmutableSortedSet.naturalOrder();
Collection<String> pathParameters = methodConfig.getPathParameters();
List<String> order = new ArrayList<>(pathParameters);
for (ApiParameterConfig parameterConfig : methodConfig.getParameterConfigs()) {
if (parameterConfig.getClassification() == Classification.API_PARAMETER
&& !pathParameters.contains(parameterConfig.getName())
&& !parameterConfig.getNullable()) {
queryParamBuilder.add(parameterConfig.getName());
}
}
List<String> order = new ArrayList<>(pathParameters);
order.addAll(queryParamBuilder.build());
return order;
}
Expand Down

0 comments on commit 8794cce

Please sign in to comment.