This repository has been archived by the owner on Jan 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 601
exclude_namespaces is ignored for related endpoints #348
Comments
I had the exact same problem just now - there's a recursion in a URL completely unrelated to our API, which crashes the swagger doc generator. |
tiagovanderlei
added a commit
to Mobillers/django-rest-swagger
that referenced
this issue
Dec 18, 2015
… appropriately. Issue: "exclude_namespaces is ignored for related endpoints marcgibbons#348"
@Laughing-Man, i came to the same solution as you, once Swagger actually ignores the exclude namespaces variable when looks for the endpoints content. When i debug i realized that the group is retrieved properly because exclude_namespaces is checked, but when it looks for the apis to be listed for each group, it doesnt check directly their namespaces and all of group apis are shown. |
have you created a branch and/or a pull request ? |
urlpatterns may explicitly be listed now in DRF 3.4 on the schema generator. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Issue occurs in views.SwaggerApiView.get_apis_for_resource()
If an excluded url shares a resource path with another api that isn't excluded, it will still get picked up by the above method and displayed. A 2 line change fixes this, but I can't tell if there's some reason why this would be otherwise desirable.
Example:
/api/things/{group}/
/api/things/{group}/paged/{page}/
If I put the second url in an excluded namespace, it will still get picked up and included in the docs, because the aforementioned method only uses a filter_path to assemble its list of apis, and doesn't check the excluded list.
This is what fixed it for me.
This change makes everything behave in the way I intended, but will this have unexpected consequences for me later? Also, is this situation idiosyncratic to my use case or something that should be corrected?
The text was updated successfully, but these errors were encountered: