Open docktermj opened 1 year ago
Server
type implements http.Handler
and could be wrapped by any middleware like https://github.com/rs/cors to add more response headers.
But probably we should provide a function to get some information about every route: HTTP method, response headers, etc. It would make CORS setup easier.
@tdakkota That would be nice. Thank you for considering it.
@docktermj like this
First of all: Bravo on
ogen
. An excellent piece of software.Given that the SwaggerUI (https://petstore.swagger.io/) is part of the OpenAPI ecosystem, it would be nice if the SwaggerUI could easily work with the server generated by https://github.com/ogen-go/ogen.
curl
calls andhttp
requests from the browser work well. However, when using the SwaggerUI application, CORS presents a problem.According to the documentation given by SmartBear (who supports Swagger):
the following headers need to be in the response:
I can't seem to find a clear explanation of how to include extra HTTP response headers from the code generated by
ogen
. The examples on middleware.Middleware and ServerOptions aren't giving a clear picture as to whether or not this is the approach used.So,
ogen
?