swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Swagger ui on https, requesting api on Http (TypeError: NetworkError when attempting to fetch resource.)

Open KamranShahid opened this issue 6 years ago • 2 comments

I have a swagger editor hosted locally on some https url. My Api's are on http. when calling the api i am getting above mentioned error. Is there any way i can avoid (TypeError: NetworkError when attempting to fetch resource.) which seem due to CORS or un-matched schemes. On my calling api i have have added CORS exception for my swagger api url which is on https but still getting same error. Any way i can avoid this error by changing something in swagger editor hosted locally

KamranShahid avatar Nov 25 '19 06:11 KamranShahid

Duplicate of #https://github.com/swagger-api/swagger-ui/issues/4586

mojtaba-zolfaghari avatar Dec 29 '19 07:12 mojtaba-zolfaghari

  • browse "https://host.docker.internal/identity/connect/token" this url in new tab of your browser or the url where u r getting error.....u can find that url by doing F12 and see errors........
  • try to access it forcefully with options like advanced...etc....
  • it will then show {"error":"invalid_request"}
  • now go back to your swagger tab and authorize it with creds.....it will work....

prakashpawarnhs avatar Mar 12 '21 10:03 prakashpawarnhs