-
Notifications
You must be signed in to change notification settings - Fork 208
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
Fixed unable to validate schema with type: array #196
Fixed unable to validate schema with type: array #196
Conversation
lib/deref.js
Outdated
@@ -20,6 +20,11 @@ const _ = require('lodash'), | |||
PARAMETER_SOURCE = { | |||
REQUEST: 'REQUEST', | |||
RESPONSE: 'RESPONSE' | |||
}, | |||
// Specifies type of Resolving of Refs that can be performed | |||
RESOLVE_REFS_FOR = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems incorrectly named
the validation/conversion should be in a different enum - PROCESSING_TYPE, for example
lib/schemaUtils.js
Outdated
@@ -64,6 +64,11 @@ const async = require('async'), | |||
RESPONSE_HEADER: 'response header', | |||
RESPONSE_BODY: 'response body' | |||
}, | |||
// Specifies types of Resolving of Refs that can be performed | |||
RESOLVE_REFS_FOR = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this enum should only be defined in one place
lib/deref.js
Outdated
// This nonsense is needed because the schemaFaker doesn't respect options.maxItems/minItems | ||
schema.maxItems = 2; | ||
schema.minItems = 2; | ||
// Set minItems and maxItems property as 2 for CONVERSION |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also explain why
I can tell that you're setting max/min to 2 for conversion. The comment should explain why you're not doing that for validation
…TYPE and added decriptive comment for setting minItems and maxItems properties to 2
Issue : postmanlabs/postman-app-support#8098
Bug was happening due to always overriding
minItems
andmaxItems
properties to 2 for type: array inderef.resolveRefs()
.Added support for Resolving refs for CONVERSION/VALIDATION in
deref.resolveRefs()
function.