pksunkara / alpaca

Given a web API, Generate client libraries in node, php, python, ruby
Mozilla Public License 2.0
2.45k stars 89 forks source link

Error PHP url_use parameter option #37

Closed index0h closed 10 years ago

index0h commented 10 years ago

Hi there.

There is an error with generated result of method with url_use = true in php result.

Next api.json part

// ...
    "class": {
        "domain": {
            "retrieve": {
                "path": "/domains/:name",
                "method": "get",
                "params": [
                    {
                        "name": "name",
                        "required": true,
                        "url_use": true
                    }
                ]
            }
        }
// ...

generates

/**
 * domain retrieve desc
 *
 * '/domains/:name' GET
 *
 * @param $name domain retrieve name desc
 */
public function retrieve($name, array $options = array())
{
    $body = (isset($options['query']) ? $options['query'] : array());

    $response = $this->client->get('/domains/'.rawurlencode(name).'', $body, $options);

    return $response;
}

The problem is rawurlencode(name), it must be rawurlencode($name)

Regards