Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-26080

Can't register REST routes with different prefix

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Low Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.0
    • Component/s: Platform > REST API v2
    • Labels:
      None

      Description

      As a bundle developers, we're not able to register new REST routes with different prefix. RequestListener forces to use one common prefix for every REST call (/api/ezp/v2 by config) even if some are not ezp nor v2.

        Activity

        Show
        Sławomir Uchto added a comment - * PR *: https://github.com/ezsystems/ezpublish-kernel/pull/1731
        Show
        André Rømcke added a comment - Merged: https://github.com/ezsystems/ezpublish-kernel/commit/96562f38f8f006113ad9cf4336e6739f9b7764c4
        Hide
        Rui Silva (Inactive) added a comment -

        Sławomir Uchto, on lack of steps to reproduce, so QA can test this, I went searching on the doc about extending the rest api as a starting point to test this.
        I went following this doc.
        Despite the countless errors on this doc page (from the lack of "Action" suffix on controller actions, route settings and namespace inconsistencies on the example files and location of the php classes), I tried to adapt all errors into a setup that would work.
        I followed the doc up to right before "Cache handling" section, which as far as I understood should be enough to have a custom rest route working for a GET request, for instance.
        Thus I proceeded on doing a curl request with:

        curl -i -X GET http://master.rui/api/ezp/v2/ezp26080/hello/Rui
        

        where:
        ezp26080/hello/
        is my custom rest route, "Rui" is some name parameter.
        When I run this I'm getting:

        HTTP/1.1 500 Internal Server Error
        Date: Wed, 24 Aug 2016 10:24:32 GMT
        Server: Apache/2.4.10 (Debian)
        Cache-Control: private
        Vary: X-User-Hash
        Content-Length: 376
        Connection: close
        Content-Type: application/vnd.ez.api.ErrorMessage+xml
         
        <?xml version="1.0" encoding="UTF-8"?>
        <ErrorMessage media-type="application/vnd.ez.api.ErrorMessage+xml"><errorCode>500</errorCode><errorMessage>Internal Server Error</errorMessage><errorDescription>Output visiting failed: Invalid start: Trying to open valueElement inside document, valid parent nodes are: objectElement, hashElement, list.</errorDescription></ErrorMessage>
        

        whence, from the error I get, it seems to have something to do with the ValueObjectVisitor code (which follows exactly what is in the doc).
        Any ideas about this? Or can you inform if you happen to know more direct steps to be able to test this other than following this doc?
        I am available to provide my custom bundle which I'm starting to test this with.
        Thanks.

        Show
        Rui Silva (Inactive) added a comment - Sławomir Uchto , on lack of steps to reproduce, so QA can test this, I went searching on the doc about extending the rest api as a starting point to test this. I went following this doc . Despite the countless errors on this doc page (from the lack of "Action" suffix on controller actions, route settings and namespace inconsistencies on the example files and location of the php classes), I tried to adapt all errors into a setup that would work. I followed the doc up to right before "Cache handling" section, which as far as I understood should be enough to have a custom rest route working for a GET request, for instance. Thus I proceeded on doing a curl request with: curl -i -X GET http://master.rui/api/ezp/v2/ezp26080/hello/Rui where: ezp26080/hello/ is my custom rest route, "Rui" is some name parameter. When I run this I'm getting: HTTP/1.1 500 Internal Server Error Date: Wed, 24 Aug 2016 10:24:32 GMT Server: Apache/2.4.10 (Debian) Cache-Control: private Vary: X-User-Hash Content-Length: 376 Connection: close Content-Type: application/vnd.ez.api.ErrorMessage+xml   <?xml version="1.0" encoding="UTF-8"?> <ErrorMessage media-type="application/vnd.ez.api.ErrorMessage+xml"><errorCode>500</errorCode><errorMessage>Internal Server Error</errorMessage><errorDescription>Output visiting failed: Invalid start: Trying to open valueElement inside document, valid parent nodes are: objectElement, hashElement, list.</errorDescription></ErrorMessage> whence, from the error I get, it seems to have something to do with the ValueObjectVisitor code (which follows exactly what is in the doc). Any ideas about this? Or can you inform if you happen to know more direct steps to be able to test this other than following this doc? I am available to provide my custom bundle which I'm starting to test this with. Thanks.
        Hide
        Miguel das Neves Jacinto (Inactive) added a comment -

        QA Approved

        Show
        Miguel das Neves Jacinto (Inactive) added a comment - QA Approved

          People

          • Assignee:
            Unassigned
            Reporter:
            Sławomir Uchto
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: