Swagger 2.0 TypeError: NetworkError when attempting to fetch resource.

4,129 views
Skip to first unread message

Muhammed Oladipupo Elegbede

unread,
Sep 14, 2017, 4:28:15 PM9/14/17
to Swagger
Hi all,

I have successfully written my documentation both online and locally on my machine.

When I do a try it out to test the API, it generates the right curl syntax.

When I run this curl locally on my machine, everything works fine and the desired result comes through.

However on the swagger documentation interface, it returns: 

TypeError: NetworkError when attempting to fetch resource.
 and the status code stands at:401 UNAUTHORIZED

I would appreciate any pointer as to what could be wrong. I am struggling with this badly.

Thanks.

Ron Ratovsky

unread,
Sep 15, 2017, 5:59:19 AM9/15/17
to swagger-sw...@googlegroups.com

Most likely your server has CORS misconfigured and requires authentication for OPTION calls.

Find a way to disable that and it should work.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Muhammed Oladipupo Elegbede

unread,
Sep 15, 2017, 6:14:52 AM9/15/17
to Swagger
Thanks Ron.

I have heard this over and over but I am not able to make any sense of how to go about it.

I need a step by step approach as I have not done anything like this before.

Where do I go to, if I have to write a custom file, where do I put this file etc..

I have read all possible documentations and comments on forum and it all looks vague.

I have access to my local machine and scripts only so I am looking for a solution that I can incorporate at this level.

Thanks.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.

Ron Ratovsky

unread,
Sep 15, 2017, 6:17:38 AM9/15/17
to swagger-sw...@googlegroups.com

The problem is that it really depends on which web server you use, as the solution would differ from one to the other.

As you can imagine, I’m definitely not an expert on all those out there.

 

Which one do you use?

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.


For more options, visit https://groups.google.com/d/optout.

--

You received this message because you are subscribed to the Google Groups "Swagger" group.

To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages