You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Play routing hierarchy for the API v0 will result in calls never being executed.
E.g.: When calling /api/v0/case/task the intended behaviour would be to follow this routing entry: Line 110: case GET(p"/case/task") => queryExecutor.task.search
But instead the entry: Line 63: case GET(p"/case/$caseId") => caseCtrl.get(caseId) will be called with the $caseID = "task".
This is due to the nature of Play iterating through the routing entries from top to bottom. (atleast that is what it looks like in the debugger)
It looks like the example above is currently the only entry where this problem occurs but it is not limited to this in the future
Steps to Reproduce
Start TheHive4
Call to /api/v0/case/task
Returns RichCase not found
With debugger attached you can see that it calls /v0/CaseCtrl.scala: get(caseIdOrNumber) and not queryExecutor.task.search
Possible Solutions
Not using nested resource for naming of REST API endpoints or restructure of the routing hierarchy.
The text was updated successfully, but these errors were encountered:
Several API Endpoints could never get called due to the routing structure
Request Type
Bug
Work Environment
Problem Description
The Play routing hierarchy for the API v0 will result in calls never being executed.
E.g.: When calling
/api/v0/case/task
the intended behaviour would be to follow this routing entry:Line 110: case GET(p"/case/task") => queryExecutor.task.search
But instead the entry:
Line 63: case GET(p"/case/$caseId") => caseCtrl.get(caseId)
will be called with the $caseID = "task".This is due to the nature of Play iterating through the routing entries from top to bottom. (atleast that is what it looks like in the debugger)
It looks like the example above is currently the only entry where this problem occurs but it is not limited to this in the future
Steps to Reproduce
to /api/v0/case/task
RichCase not found
/v0/CaseCtrl.scala: get(caseIdOrNumber)
and notqueryExecutor.task.search
Possible Solutions
Not using nested resource for naming of REST API endpoints or restructure of the routing hierarchy.
The text was updated successfully, but these errors were encountered: