From 0904b3fec24edc56c4a4951501fe02ae22fd852b Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sat, 27 Jun 2020 19:41:08 +0300 Subject: [PATCH] fix: fix expand variable for vars with hyphens or dots fixes #926 --- src/utils/openapi.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/openapi.ts b/src/utils/openapi.ts index 3dba3d2287..736999edc7 100644 --- a/src/utils/openapi.ts +++ b/src/utils/openapi.ts @@ -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, ); }