Open Dindaleon opened 4 years ago
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.
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();
}
(I have that library working with this setup)
Is it possible to have a swagger plugin for polka? Or maybe an alternative...