Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Cannot match route when creating new RPC service #231

Open
cookejames opened this issue Sep 13, 2014 · 2 comments
Open

Cannot match route when creating new RPC service #231

cookejames opened this issue Sep 13, 2014 · 2 comments

Comments

@cookejames
Copy link

With version 1.0.4 when you create a new RPC service the route is initially not matchable unless you put a forward slash preceding your route name. The problem is in the module.config.php

Replicate this by creating a new RPC service, in my case with the service name updateWeather and route to match as update-weather.

Below is generated module.config.php snippet. Note that the route is missing a preceding forward slash. By default trying to access /update-weather does not match a route, adding the forward slash makes the route valid.

Obviously I didn't add the slash when I should have however there was no indication I should and the REST services create the route for you with the slash. There should be validation that the route starts with a slash or one added for you.

            'sarah.rpc.update-weather' => array(
                'type' => 'Segment',
                'options' => array(
                    'route' => 'update-weather',
                    'defaults' => array(
                        'controller' => 'sarah\\V1\\Rpc\\UpdateWeather\\Controller',
                        'action' => 'updateWeather',
                    ),
                ),
            ),
@Nguimjeu
Copy link

@cookejames I had the same issue also with RPC sevices. The auto-generated code did not added the slash for the route

@michalbundyra
Copy link
Member

This repository has been closed and moved to laminas-api-tools/api-tools-admin; a new issue has been opened at laminas-api-tools/api-tools-admin#45.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants