-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
SchemaGenerator outputs non-functional URLs when using Django 2.0 path() #5686
Comments
SchemaGenerator uses EDIT: No, everything fine there as they call |
@tiltec I don't see how calling str helps? care to elaborate? |
Ah, I see now, django gets around this by calling str() directly on the django-rest-framework does it in the opposite way, and grabs the regex from the |
Exactly! |
True, I didn't notice this one. Close here and move discussion to the other one? |
Checklist
master
branch of Django REST framework.Steps to reproduce
Create a Django 2.0 URLconf and generate a schema from it.
Expected behavior
Get a schema with urls
/example/
and/example/{id}/
Actual behavior
Got
/example\\/
and/example\\/{id}\\/
.Ref: marcgibbons/django-rest-swagger#718
Background
Django 2.0 auto-escapes the string passed into
path()
, see this piece of codePossible solution
SchemaGenerator could undo this escaping when building the schema, I'm working on PR that does this.
The text was updated successfully, but these errors were encountered: