Skip to content

Commit

Permalink
fix: fix expand variable for vars with hyphens or dots
Browse files Browse the repository at this point in the history
fixes #926
  • Loading branch information
RomanHotsiy committed Jun 27, 2020
1 parent 633d712 commit c2cde03
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ export function mergeSimilarMediaTypes(

export function expandDefaultServerVariables(url: string, variables: object = {}) {
return url.replace(
/(?:{)(\w+)(?:})/g,
/(?:{)([\w-]+)(?:})/g,
(match, name) => (variables[name] && variables[name].default) || match,
);
}
Expand Down

0 comments on commit c2cde03

Please sign in to comment.