[MGNLREST-162] Query with orderBy parameter should work without 'asc' or 'desc'. Created: 28/Dec/17  Updated: 10/Feb/18  Resolved: 09/Feb/18

Status: Closed
Project: Magnolia REST Framework
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1

Type: Improvement Priority: Neutral
Reporter: Christopher Zimmermann Assignee: Hieu Nguyen Duc
Resolution: Fixed Votes: 0
Labels: consolidation
Remaining Estimate: 0d
Time Spent: 1d 7h
Original Estimate: 1.5d

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Documentation update required:
Yes
Sprint: Saigon 132, Saigon 133
Story Points: 2

 Description   

Currently if you supply orderBy in a query, but omit the direction, the query has an exception with a cryptic error message.

The query should work when no direction is supplied and default to 'asc' as a direction.

To reproduce:
Use this URL: https://demopublic.magnolia-cms.com/.rest/delivery/tours/v1/?orderBy=location

Get this result:
{{Query:
SELECT * FROM [nt:base] AS t WHERE ([jcr:primaryType] = 'mgnl:content') ORDER BY t.[locatio(*)n; expected: a token}}


Generated at Mon Feb 12 06:57:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.