I am trying to generate a route in CakePHP 3. I have a controller called `ContractsController`, and within that I have an action - `details($id)`.

I want to map the `details($id)` action to:

`/api/contracts/details/id.json`

I have gotten as far as the following (in `routes.php`):

```
Router::scope('/api', function ($routes) {
    $routes->extensions(['json']);
    $routes->resources('Contracts', [
        'map' => [
            'details' => [
                'action' => 'details',
                'method' => 'GET'
            ]
        ]
    ]);
});

```

This allows me to access the `details` action through `/api/contracts/details.json` but I can't figure out how to pass an id with it.