mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Validation bugfixes
This commit is contained in:
@@ -2199,18 +2199,21 @@ module.exports = {
|
||||
|
||||
if (!schemaContent) {
|
||||
// no specific or default response with application/json
|
||||
return callback(null, [{
|
||||
property: mismatchProperty,
|
||||
transactionJsonPath: transactionPathPrefix,
|
||||
schemaJsonPath: null,
|
||||
reasonCode: 'BODY_SCHEMA_NOT_FOUND',
|
||||
reason: 'No application/json schema found for this response'
|
||||
}]);
|
||||
// return callback(null, [{
|
||||
// property: mismatchProperty,
|
||||
// transactionJsonPath: transactionPathPrefix,
|
||||
// schemaJsonPath: null,
|
||||
// reasonCode: 'BODY_SCHEMA_NOT_FOUND',
|
||||
// reason: 'No JSON schema found for this response'
|
||||
// }]);
|
||||
|
||||
// cannot show mismatches if the schema didn't have any application/JSON response
|
||||
return callback(null, []);
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
return this.checkValueAgainstSchema(mismatchProperty,
|
||||
transactionPathPrefix + '.body',
|
||||
transactionPathPrefix,
|
||||
body,
|
||||
schemaPathPrefix + '.content[application/json].schema',
|
||||
deref.resolveRefs(schemaContent, 'response', components),
|
||||
@@ -2252,7 +2255,7 @@ module.exports = {
|
||||
body: (cb) => {
|
||||
// assume it's JSON at this point
|
||||
this.checkResponseBody(thisSchemaResponse, response.body,
|
||||
transactionPathPrefix + '.' + response.id + '.body',
|
||||
transactionPathPrefix + '[' + response.id + ']body',
|
||||
schemaPathPrefix + '.responses.' + responsePathPrefix, components, options, cb);
|
||||
}
|
||||
}, (err, result) => {
|
||||
|
||||
Reference in New Issue
Block a user