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

/openapi should provider CORS headers #416

Closed
rafabene opened this issue Mar 31, 2020 · 7 comments · Fixed by #521
Closed

/openapi should provider CORS headers #416

rafabene opened this issue Mar 31, 2020 · 7 comments · Fixed by #521
Assignees

Comments

@rafabene
Copy link

Since 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.

@EricWittmann
Copy link
Contributor

We'll discuss this in the next hangout.

@phillip-kruger
Copy link
Member

Quarkus does have it in the vert.x router.

@EricWittmann
Copy link
Contributor

@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.

@MikeEdgar
Copy link
Member

I agree, this can be handled in implementations

@MikeEdgar
Copy link
Member

Closing issue. As noted in earlier comments, this is something that will continue to be not included in the specification.

@Emily-Jiang
Copy link
Member

@MikeEdgar I think it will be a good support for CORS header though. @tjquinno what do you think?

@Emily-Jiang
Copy link
Member

@MikeEdgar I reopened this issue for further discussion. If we all think it is not something we should spec, we can then close it.

@Emily-Jiang Emily-Jiang reopened this Feb 28, 2022
Azquelt pushed a commit to Azquelt/microprofile-open-api that referenced this issue Mar 17, 2022
…all HTTP Methods.

Signed-off-by:Phillip Kruger <phillip.kruger@gmail.com>
@Emily-Jiang Emily-Jiang self-assigned this Mar 22, 2022
@Azquelt Azquelt added this to the MP OpenAPI 3.1 milestone Jun 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants