This repository was archived by the owner on Jan 21, 2020. It is now read-only.
Support nested namespace in API name #19
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!