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

MulterOptions required when having securityHandlers #226

Closed
comino opened this issue Jan 30, 2020 · 1 comment · Fixed by #227
Closed

MulterOptions required when having securityHandlers #226

comino opened this issue Jan 30, 2020 · 1 comment · Fixed by #227

Comments

@comino
Copy link
Collaborator

comino commented Jan 30, 2020

Updating from 2.13.x to 2.15 and also 3.x causes an error message on startup:
"Error: multerOpts must be an object or undefined"

index.js:

validateOptions(options) {
        // ...... 
        const multerOpts = options.multerOpts;
        if (securityHandlers != null) {
            if (typeof multerOpts !== 'object' || Array.isArray(securityHandlers)) {
                throw ono_1.default('multerOpts must be an object or undefined');
            }
            util_1.deprecationWarning('multerOpts is deprecated. Use fileUploader instead.');
        }
       // .....

I don't really understand why we would check for "securityHandlers" at that place. I assume the author meant to check multerOpts instead so like:

validateOptions(options) {
        // ...... 
        const multerOpts = options.multerOpts;
        if (multerOpts != null) {
            if (typeof multerOpts !== 'object' || Array.isArray(multerOpts)) {
                throw ono_1.default('multerOpts must be an object or undefined');
            }
            util_1.deprecationWarning('multerOpts is deprecated. Use fileUploader instead.');
        }
       // .....
@comino comino changed the title MulterOptions required when having MulterOptions required when having securityHandlers Jan 30, 2020
comino added a commit to comino/express-openapi-validator that referenced this issue Jan 30, 2020
@comino
Copy link
Collaborator Author

comino commented Jan 30, 2020

Send #227

If the current behavior is intentional just close MR, please.

@comino comino mentioned this issue Jan 30, 2020
cdimascio added a commit that referenced this issue Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant