Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add url prefix to DefaultRouter and SchemaGenerator init #4308

Closed
wants to merge 1 commit into from

Conversation

jsurloppe
Copy link
Contributor

@jsurloppe jsurloppe commented Jul 25, 2016

When using a DefaultRouter as a path, the schema generated by SchemaGenerator is wrong;

router = DefaultRouter(schema_title="foobar")
url(r"^api/", include(router.urls))

The schema generated will contains path like /foobar/ and not /api/foobar/, causing wrong url being used by coreapi-cli and djando-rest-swagger.

I didn't find a proper way to retrieve the prefixed path included at the time when the schema urls are generated, so i explicitly added optional arguments.

This patch add 2 arguments, the first one to DefaultRouter: schema_prefix; the second to SchemaGenerator init: prefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants