Skip to content

Commit

Permalink
fix: general cleanup (#100)
Browse files Browse the repository at this point in the history
- Added null check for server list as to not break package when incorrectly defined
- Returning path back in initial format for matching purposes
  • Loading branch information
gratcliff authored and erunion committed Jan 27, 2020
1 parent 5e6eb53 commit d00d56e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/oas.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ function generatePathMatches(paths, pathName, origin) {
url: {
origin,
path: cleanedPath,
nonNormalizedPath: path,
slugs,
},
operation: paths[path],
Expand Down Expand Up @@ -242,6 +243,7 @@ class Oas {
const originRegExp = new RegExp(origin);
const { servers, paths } = this;

if (!servers || !servers.length) return undefined;
const targetServer = servers.find(s => originRegExp.exec(s.url));
if (!targetServer) return undefined;

Expand Down

0 comments on commit d00d56e

Please sign in to comment.