Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/schemaUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1842,12 +1842,24 @@ module.exports = {
// first step - get array of requests from schema
let parsedUrl = require('url').parse(url),
retVal = [],
pathToMatch = decodeURI(parsedUrl.pathname),
pathToMatch,
matchedPath,
matchedPathJsonPath,
schemaPathItems = schema.paths,
filteredPathItemsArray = [];

// Return no matches for invalid url (if unable to decode parsed url)
try {
pathToMatch = decodeURI(parsedUrl.pathname);
}
catch (e) {
console.warn(
'Error decoding request URI endpoint. URI: ', url,
'Error', e
);
return retVal;
}

// if pathToMatch starts with '/', we assume it's the correct path
// if not, we assume the segment till the first '/' is the host
// this is because a Postman URL like "{{url}}/a/b" will
Expand Down