Open oppianmatt opened 10 years ago
problem with that though is that it's designed to display the endpoints without a slash so when it does have a slash it look like a list of /
but really you shouldn't be relying on a 302 redirect to get to the right place from some middleware that might not be enabled
Actually this is on purpose to match the swagger specifications The real fix would be I guess to remove the trailing slash from the url conf.
Its not a matter of middleware btw but just a settings (APPEND_SLASH) edit: well its a combinaison of the 2 but who wouldn't use common middleware in django anyway ?
you sir are correct. I found this issue when I put in a catch all that matches everything not matched by other urlconfs (because we needed to redirect old links) and that broke swagger. I've made it a negative match. If the url matched the url conf it wouldn't be affected. Looking at swagger when it works, you see a bunch of 301 redirects, so fixing this would improve performance slightly (and help others who have the setting off, or urls confs that will match)
We are open to PR ;)
In views.py we have:
it's creating links like /schema/resource
but in urls.py we have
note that it has a trailing slash
fix is to change the a line to:
People aren't seeing the issue because there is usually middleware which adds a slash for when it 404s making it work.