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

Resolving of not is incorrect #97

Closed
yehtutlwin opened this issue Sep 28, 2020 · 0 comments · Fixed by #108
Closed

Resolving of not is incorrect #97

yehtutlwin opened this issue Sep 28, 2020 · 0 comments · Fixed by #108

Comments

@yehtutlwin
Copy link

Currently, the not resolution assumes that it is an array

enjoi/lib/resolver.js

Lines 195 to 201 in abdd705

resolveNot(schema) {
Hoek.assert(Util.isArray(schema.not), 'Expected Not to be an array.');
return this.joi.alternatives().conditional(Joi.alternatives().try(...schema.not.map((schema) => {
return this.resolve(schema);
})), { then: this.joi.any().forbidden(), otherwise: this.joi.any() });
}

However, according to OAS, not is an object, not an array. (https://swagger.io/docs/specification/data-models/oneof-anyof-allof-not/)

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