Skip to content

Conversation

@jsurloppe
Copy link
Contributor

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.

2 participants