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 Integration #130

Open
Dindaleon opened this issue Mar 26, 2020 · 3 comments
Open

OpenAPI Integration #130

Dindaleon opened this issue Mar 26, 2020 · 3 comments
Labels

Comments

@Dindaleon
Copy link

Is it possible to have a swagger plugin for polka? Or maybe an alternative...

@lukeed
Copy link
Owner

lukeed commented Mar 26, 2020

Yes, there will be an OpenAPI integration, but not as part of 1.0.

I can't tell if it makes sense as a plugin or if it should be a larger framework that builds upon Polka. I'm leaning towards the latter because in order for OpenAPI to make sense (and work) it has to be strictly implemented.

@lukeed lukeed added the future label Mar 26, 2020
@lukeed lukeed changed the title Swagger implementation OpenAPI Integration Mar 26, 2020
@jgod
Copy link

jgod commented Dec 26, 2020

A first step could be getting a "plugin" (PR) for https://github.com/PayU/openapi-validator-middleware, which already supports express, koa, and fastify. It looks like we're missing req.baseUrl and req.route.path that it relies on from express, whenever I try to just import it and use it in express-mode.

Something like this to make it compatible:

function reqEnhancer(req, res, next) {
  req.baseUrl = "";
  req.route = {
    path: req.path,
  };
  next();
}

@jgod
Copy link

jgod commented Dec 26, 2020

(I have that library working with this setup)

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

No branches or pull requests

3 participants