REPO-1059: REST API: Invalid orderBy field direction is ignored (hence defaults to ascending rather than returning an error)

- implement fix & update test
- note: InvalidArgumentException maps to HTTP 400
- note: we already have tests for case-insensitive (ie. we allow ASC, Asc, AsC, DESC, Desc, DeSC, or similar)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@130555 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2016-09-12 11:17:04 +00:00
parent dd1aebb5ef
commit 566179e8b2
2 changed files with 13 additions and 9 deletions

View File

@@ -315,6 +315,7 @@ public interface RecognizedParamsExtractor
{
rpeLogger().debug("Invalid sort order definition (" + sortDef + "). Valid values are " + SortColumn.ASCENDING + " or "
+ SortColumn.DESCENDING + ".");
throw new InvalidArgumentException("Unknown sort order direction: "+sortDef+" expected: asc or desc");
}
}
sortedColumns.add(new SortColumn(columnName, SortColumn.ASCENDING.equals(sortOrder)));