You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
OpenAPI has Cookie Authentication and from this issue and code, I believe express-openapi-validator also supports it.
However, it needs to be able to access the req.cookies property for it to work, and for that we need to add cookie-parser middleware.
The documentation doesn't list that, and I had to go to the code when I got an error, which was time consuming.
Describe the solution you'd like
How about the following sample code from the Example Express API Server section of the documentation?
constexpress=require('express');constpath=require('path');consthttp=require('http');constcookieParser=require('cookie-parser');// <- add thisconstapp=express();
...
// 2. Set up body parsers for the request body types you expect// Must be specified prior to endpoints in 5.app.use(express.json());app.use(express.text());app.use(express.urlencoded({extended: false}));app.use(cookieParser());// If you want to Cookie Authentication, we can access req.cookies property // <- add this// 3. (optionally) Serve the OpenAPI spec
...
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
OpenAPI has Cookie Authentication and from this issue and code, I believe express-openapi-validator also supports it.
However, it needs to be able to access the
req.cookies
property for it to work, and for that we need to add cookie-parser middleware.The documentation doesn't list that, and I had to go to the code when I got an error, which was time consuming.
Describe the solution you'd like
How about the following sample code from the
Example Express API Server
section of the documentation?The text was updated successfully, but these errors were encountered: