•  
      request #13593 REST route PUT /user_groups/{id}/users crashes when an incorrect representation is given
    Infos
    #13593
    Thomas Gerbet (tgerbet)
    2019-07-18 11:28
    2019-07-03 11:14
    14446
    Details
    REST route PUT /user_groups/{id}/users crashes when an incorrect representation is given
    Try to call the REST route PUT /user_groups/{id}/users with a payload like {"id":102} you get a crash instead of an error with a status code 400.


    Trace:
    PHP message: PHP Fatal error: Uncaught TypeError: Argument 1 passed to Tuleap\Project\REST\UserRESTReferenceRepresentation::buildFromArray() must be of the type array, int given, called in /usr/share/tuleap/src/common/Project/REST/v1/UserGroupResource.class.php on line 300 and defined in /usr/share/tuleap/src/common/Project/REST/UserRESTReferenceRepresentation.php:45
    Stack trace:
    #0 /usr/share/tuleap/src/common/Project/REST/v1/UserGroupResource.class.php(300): Tuleap\Project\REST\UserRESTReferenceRepresentation::buildFromArray(102)
    #1 [internal function]: Tuleap\Project\REST\v1\UserGroupResource->putUsers('150', Array)
    #2 /usr/share/tuleap/src/vendor/luracast/restler/vendor/Luracast/Restler/Restler.php(1058): ReflectionMethod->invokeArgs(Object(Tuleap\Project\REST\v1\UserGroupResource), Array)
    #3 /usr/share/tuleap/src/vendor/luracast/restler/vendor/Luracast/Restler/Restler.php(304): Luracast\Restler\Restler->call()
    #4 /usr/share/tuleap/src/www/api/index.php(118): Luracast\Restler\Restler->handle(" while reading response header from upstream, client: 172.21.0.6, server: tuleap-web.tuleap-aio-dev.docker, request: "PUT /api/user_groups/150/users HTTP/1.0"
    Project admin
    All
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    Closed
    2019-07-18
    Attachments
    Empty
    References

    Follow-ups