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) {
|
if (!schemaContent) {
|
||||||
// no specific or default response with application/json
|
// no specific or default response with application/json
|
||||||
return callback(null, [{
|
// return callback(null, [{
|
||||||
property: mismatchProperty,
|
// property: mismatchProperty,
|
||||||
transactionJsonPath: transactionPathPrefix,
|
// transactionJsonPath: transactionPathPrefix,
|
||||||
schemaJsonPath: null,
|
// schemaJsonPath: null,
|
||||||
reasonCode: 'BODY_SCHEMA_NOT_FOUND',
|
// reasonCode: 'BODY_SCHEMA_NOT_FOUND',
|
||||||
reason: 'No application/json schema found for this response'
|
// 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(() => {
|
setTimeout(() => {
|
||||||
return this.checkValueAgainstSchema(mismatchProperty,
|
return this.checkValueAgainstSchema(mismatchProperty,
|
||||||
transactionPathPrefix + '.body',
|
transactionPathPrefix,
|
||||||
body,
|
body,
|
||||||
schemaPathPrefix + '.content[application/json].schema',
|
schemaPathPrefix + '.content[application/json].schema',
|
||||||
deref.resolveRefs(schemaContent, 'response', components),
|
deref.resolveRefs(schemaContent, 'response', components),
|
||||||
@@ -2252,7 +2255,7 @@ module.exports = {
|
|||||||
body: (cb) => {
|
body: (cb) => {
|
||||||
// assume it's JSON at this point
|
// assume it's JSON at this point
|
||||||
this.checkResponseBody(thisSchemaResponse, response.body,
|
this.checkResponseBody(thisSchemaResponse, response.body,
|
||||||
transactionPathPrefix + '.' + response.id + '.body',
|
transactionPathPrefix + '[' + response.id + ']body',
|
||||||
schemaPathPrefix + '.responses.' + responsePathPrefix, components, options, cb);
|
schemaPathPrefix + '.responses.' + responsePathPrefix, components, options, cb);
|
||||||
}
|
}
|
||||||
}, (err, result) => {
|
}, (err, result) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user