zfcampus / zf-apigility-documentation-swagger

BSD 3-Clause "New" or "Revised" License
11 stars 27 forks source link

Add support for multiple URL params #17

Open stringerbell opened 8 years ago

stringerbell commented 8 years ago

Currently, only optional params are exposed when looking at a service.

Example:

screen shot 2016-02-16 at 11 44 48 am

It'd be awesome to add support for non-optional params

Example:

screen shot 2016-02-16 at 11 43 59 am

In Service.php, in the toArray() method, this is happening:

$routeWithReplacements = str_replace(['[', ']', '{/', '{:'], ['{', '}', '/{', '{'], $service->route);

Changing it to:

$routeWithReplacements = preg_replace('#\[?\/:(\w+)\]?#', '/{$1}', $service->route);

will give the results I'd like to see.

If this change is acceptable, I can go ahead and make a PR, otherwise, I'm open to hearing other ideas to add support for this.

weierophinney commented 4 years ago

This repository has been closed and moved to laminas-api-tools/api-tools-documentation-swagger; a new issue has been opened at https://github.com/laminas-api-tools/api-tools-documentation-swagger/issues/10.