Uploaded image for project: 'Ibexa IBX'
  1. Ibexa IBX
  2. IBX-5509

[REST] Corporate Account Companies endpoints try to load Company when non-numeric value is passed as {companyId}

    XMLWordPrintable

Details

    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' =&gt; 0,
        'languages' =&gt; 
        array (
          0 =&gt; 'eng-GB',
        ),
        'versionNo' =&gt; 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> 

       

      Designs

        Attachments

          Activity

            People

              Unassigned Unassigned
              jakub.wesolowski@ibexa.co Jakub Wesołowski (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: