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

Fix using discriminators. #510

Merged
merged 1 commit into from Jan 7, 2021

Conversation

mat813
Copy link
Contributor

@mat813 mat813 commented Jan 5, 2021

If an object's reference has already been resolved, or if the object is not a reference, the code will abort with an error like:

node_modules/express-openapi-validator/dist/middlewares/parsers/schema.preprocessor.js:366
        return ref.split('/components/schemas/')[1];

TypeError: Cannot read property 'split' of undefined
    at SchemaPreprocessor.getKeyFromRef (node_modules/express-openapi-validator/dist/middlewares/parsers/schema.preprocessor.js:366:20)
    at node_modules/express-openapi-validator/dist/middlewares/parsers/schema.preprocessor.js:194:34
    at Array.flatMap (<anonymous>)

In this zip are two files that exhibit this issue.

If an object's reference has already been resolved, or if the object is
not a reference, the code will abort with an error like:

node_modules/express-openapi-validator/dist/middlewares/parsers/schema.preprocessor.js:366
        return ref.split('/components/schemas/')[1];
                   ^
TypeError: Cannot read property 'split' of undefined
    at SchemaPreprocessor.getKeyFromRef (node_modules/express-openapi-validator/dist/middlewares/parsers/schema.preprocessor.js:366:20)
    at node_modules/express-openapi-validator/dist/middlewares/parsers/schema.preprocessor.js:194:34
    at Array.flatMap (<anonymous>)
@cdimascio cdimascio merged commit 590649a into cdimascio:master Jan 7, 2021
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 this pull request may close these issues.

None yet

2 participants