Skip to content
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

swagger editor #7346

Closed
AlexJMcloud opened this issue Jun 15, 2021 · 11 comments
Closed

swagger editor #7346

AlexJMcloud opened this issue Jun 15, 2021 · 11 comments

Comments

@AlexJMcloud
Copy link

Failed to fetch.
Possible Reasons:

CORS
Network Failure
URL scheme must be "http" or "https" for CORS request.

Until now, your editor cannot correctly identify the error codes.
The headers are all spelled out.

Access-Control-Allow-Headers: *
Access-Control-Allow-Origin: *

swagger.yaml:

schemes:

  • https
    basePath: /api
@AlexJMcloud
Copy link
Author

From another site I am making a request via curl. And I get the server responses that should be.
When will your editor be able to read headlines normally?

@hkosova
Copy link
Contributor

hkosova commented Jun 21, 2021

What's the full error message on the Console tab in the browser dev tools?

@mathis-m
Copy link
Contributor

From another site I am making a request via curl. And I get the server responses that should be.
When will your editor be able to read headlines normally?

Network errors can not be read by Javascript this is a Browser security feature. See Originally posted by @mathis-m in #6938 (comment)

Second thing is that CORS is something that the client decides to enforce or not, browsers do other tools like postman or curl don't.

@char0n
Copy link
Member

char0n commented Sep 27, 2021

Hi @AlexJMcloud,

In order to help you, we'd need more information.

  • When you mentioned Editor did you mean https://editor.swagger.io/?
  • Are you using swagger-editor npm package and integrating in your application?
  • What is the OAS definition source (if you can disclose it)?

@AlexJMcloud
Copy link
Author

AlexJMcloud commented Sep 27, 2021 via email

@char0n char0n closed this as completed Sep 27, 2021
@dogukankrtlz
Copy link

How did you solve the issue ?

@muhammadrivaldy
Copy link

@AlexJMcloud how to fix that?

@o-medizadeh-Ard
Copy link

hi

how to fix that?

@AlexJMcloud
Copy link
Author

AlexJMcloud commented May 12, 2022 via email

@tobiolusa
Copy link

I am currently facing similar issue, How can I resolve it.

@o-medizadeh-Ard
Copy link

I am currently facing similar issue, How can I resolve it.

hi.
plese use this :
app.UseCors(x => x.AllowAnyOrigin().AllowAnyMethod().AllowAnyHeader());
in startup file Configure method.
and use app.UseSwaggerAndUI(); after the app.UseRouting(); and app.UseEndpoints(); in this method.
i resolve it with this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants