/openapi should provider CORS headers
See original GitHub issueSince CORS support is not mandatory in the specification, I’ve seen some implementations that doesn’t use CORS headers on /openapi.
However, tools like Swagger presents the following error message when consuming a MP application with OpenAPI without CORS headers: "Possible cross-origin (CORS) issue? The URL origin (http://localhost:8080) does not match the page (http://localhost). Check the server returns the correct 'Access-Control-Allow-*' headers."
This issue is to request that CORS headers should be mandatory to enable tools like Swagger-UI to consume /openapi endpoint.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Enable CORS on a resource using the API Gateway import API
... you can set up CORS support using an OpenAPI file. You must first define an OPTIONS method in your resource that returns...
Read more >CORS - Swagger Documentation
CORS and Header Parameters Swagger UI lets you easily send headers as parameters to requests. The name of these headers MUST be supported...
Read more >CORS Requirements for "Try It Out" | SwaggerHub ...
API responses must include CORS headers (see below). · API endpoints must support the OPTIONS method for CORS preflight requests. OPTIONS must not...
Read more >Enabling CORS support for Endpoints - OpenAPI
If a web server supports CORS request, it will handle the OPTIONS request with proper CORS response headers. Handle CORS in your backend...
Read more >Authoritative guide to CORS (Cross-Origin Resource Sharing ...
An in-depth guide to Cross-Origin Resource Sharing (CORS) for REST APIs, on how CORS works, and common pitfalls especially around security.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@MikeEdgar I reopened this issue for further discussion. If we all think it is not something we should spec, we can then close it.
@phillip-kruger confirmed that Quarkus has CORS enabled for the
/openapi
endpoint but we’ll need to double check on Thorntail and WildFly. We discussed this on the call today and we are not convinced that CORS is something the spec should be mandating. So I think we’re inclined to close this as rejected, unless @MikeEdgar or @arthurdm (or anyone else) have dissenting opinions.