Properly render sort variable variable as composite.

HateoasSortHandlerMethodArgumentResolver now renders the sort template variable as composite to properly indicate that it can be submitted multiple times.

Fixes GH-2531.
Original pull request GH-2945.
This commit is contained in:
Julien Béti
2023-09-28 10:48:13 +02:00
committed by Oliver Drotbohm
parent 78267402bf
commit fa9d7bdce7
3 changed files with 13 additions and 10 deletions

View File

@@ -35,6 +35,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* @author Oliver Gierke
* @author Thomas Darimont
* @author Nick Williams
* @author Julien Béti
*/
public class HateoasSortHandlerMethodArgumentResolver extends SortHandlerMethodArgumentResolver
implements UriComponentsContributor {
@@ -58,7 +59,7 @@ public class HateoasSortHandlerMethodArgumentResolver extends SortHandlerMethodA
String description = String.format("pagination.%s.description", sortParameter);
TemplateVariable.VariableType type = append ? REQUEST_PARAM_CONTINUED : REQUEST_PARAM;
return new TemplateVariables(new TemplateVariable(sortParameter, type, description));
return new TemplateVariables(new TemplateVariable(sortParameter, type, description).composite());
}
@Override