Details
-
Bug
-
Resolution: Fixed
-
Medium
-
4.5
-
Ibexa Experience
Description
Numeric requirement for companyId route parameter is missing in all /corporate/companies endpoints. This makes REST controller (ParamConverter to be specific) cast these values to int. If we skip casting somewhere we'll end up with Fatal error as Public API is strictly typed. Route should accept only numeric response and for non-numeric respond with HTTP 404 Not Found.
Steps to reproduce
GET /corporate/companies/foo
Actual response heading:
<ErrorMessage media-type="application/vnd.ibexa.api.ErrorMessage+xml"> <errorCode>404</errorCode> <errorMessage>Not Found</errorMessage> <errorDescription>Could not find 'Content' with identifier 'array ( 'id' => 0, 'languages' => array ( 0 => 'eng-GB', ), 'versionNo' => NULL, )'</errorDescription>
Expected response heading:
<ErrorMessage media-type="application/vnd.ibexa.api.ErrorMessage+xml"> <errorCode>404</errorCode> <errorMessage>Not Found</errorMessage> <errorDescription>No route found for "GET .../api/ibexa/v2/corporate/companies/foo"</errorDescription>