Handling parameters with a missing schema property

This commit is contained in:
Abhijit Kane
2020-01-02 16:22:40 +05:30
parent fa0ba331cd
commit 4f2347154b

View File

@@ -1851,6 +1851,10 @@ module.exports = {
}
setTimeout(() => {
if (!schemaPathVar.schema) {
// no errors to show if there's no schema present in the spec
return cb(null, []);
}
this.checkValueAgainstSchema(mismatchProperty,
transactionPathPrefix,
pathVar.value,
@@ -1931,6 +1935,10 @@ module.exports = {
// query found in spec. check query's schema
setTimeout(() => {
if (!schemaParam.schema) {
// no errors to show if there's no schema present in the spec
return cb(null, []);
}
this.checkValueAgainstSchema(mismatchProperty,
transactionPathPrefix + '[?(@.key==\'' + pQuery.key + '\')]',
pQuery.value,
@@ -1985,6 +1993,10 @@ module.exports = {
// header found in spec. check header's schema
setTimeout(() => {
if (!schemaHeader.schema) {
// no errors to show if there's no schema present in the spec
return cb(null, []);
}
this.checkValueAgainstSchema(mismatchProperty,
transactionPathPrefix + '[?(@.key==\'' + pHeader.key + '\')]',
pHeader.value,
@@ -2048,6 +2060,10 @@ module.exports = {
// header found in spec. check header's schema
setTimeout(() => {
if (!schemaHeader.schema) {
// no errors to show if there's no schema present in the spec
return cb(null, []);
}
return this.checkValueAgainstSchema(mismatchProperty,
transactionPathPrefix + '/' + pHeader.key,
pHeader.value,