marcgibbons / django-rest-swagger

Swagger Documentation Generator for Django REST Framework: deprecated
https://marcgibbons.com/django-rest-swagger/
BSD 2-Clause "Simplified" License
2.59k stars 599 forks source link

Error 'cannot find file' in newer version #640

Open mke21 opened 7 years ago

mke21 commented 7 years ago

Hi,

I upgraded from a very old version (0.3.6) of Django-rest-swagger to the newer version 2.1.2 and now I got a problem. The swagger site now produces an error: {"schemaValidationMessages":[{"level":"error","message":"Can't read from file https://localhost/apidocs/?format=openapi"}]}

Update: I have changed this ticket as I now partly understand why this problem occurs. It seems like django-swagger doesn't recognise that it should be using ssl (https). It tries to find the api-urls under http, which doesn't work of course. Then it produces this error. How can I force django-swagger to add https with the urls?

diogobaeder commented 7 years ago

This issue is affecting my application as well. However, I'm seeing it happening locally, without using SSL at all. And if I just try to load the URL accused in the error message, it loads just fine for me. I think it's an issue with reading the content of the response.

P.S.: Not sure how relevant this is, but I'm using Python 3.6.

kinesii commented 7 years ago

You guys figure this out? I am experiencing the same thing, with Django 1.10.5

brentstrange commented 6 years ago

Experiencing this over SSL as well (not publicly accessible). The file/URL that it claims can't be read from DOES load and the JSON is valid. I'm running: Django==1.11.9 djangorestframework==3.7.7 django-filter==1.1.0 django-rest-swagger==2.1.2 nose-parameterized==0.5.0 django-cors-headers==2.1.0 django-cors-middleware==1.3.1

ankittyagi20 commented 6 years ago

I'm using Django == 2.0 and django-rest-swagger == 2.1.2, facing the same problem.