zfcampus/zf-apigility-documentation — pull request #19 by kevinpapst (2014-12-05 15:27:49+00:00)
Title: Support nested namespace in API name

Hi,
I had some troubles accessing the auto generated documentation for REST APIs, which use nested namespaces. By default Apigility creates new APIs without any preceding namespace, like this:
"ApiName\\V1\\MyApi\\MyApiResource"
But it supports APIs with deeper namespaces (like "Company\\Rest\\ApiName\\V1\\MyApi\\MyApiResource") as well.
Even in the admin/settings UI where namespace separator are converted to a dot like this:
https://myApigility.dev/apigility/ui#/api/Company.Rest.ApiName/v1/rest-services?view=settings

You can see that conversion for example in \ZF\Apigility\Admin\Model\VersioningModelFactory::normalizeModuleName()

But: nested namespaces are not supported in the documentation module, generated URLs look like this:
https://myApigility.dev/apigility/documentation/Company\Rest\ApiName-v1
=> breaks routing and leads to a 404.

My questions are: Is that on purpose? Is there any reason for this behavior? And is there another way to achieve my goal (support APIs with deeper namespace nesting) without the attached code changes?

My pull request includes a quick way to fix that, but as I don't know the reason for the original behavior, I have no idea whether this might break anything else (including backward compatibility).

Any feedback is highly appreciated. And thanks for that great product!