Skip to content

Commit

Permalink
chore: enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
char0n committed May 8, 2024
1 parent 21520e5 commit 0a64afb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
3 changes: 1 addition & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"^@swagger-api/apidom-reference/dereference/strategies/openapi-3-1/selectors/uri$",
"^@swagger-api/apidom-reference/resolve/resolvers/file$",
"^@swagger-api/apidom-reference/resolve/strategies/openapi-3-1$",
"^@swagger-api/apidom-reference/parse/parsers/binary$",
"openapi-path-templating"
"^@swagger-api/apidom-reference/parse/parsers/binary$"
]
}
],
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"js-yaml": "^4.1.0",
"node-abort-controller": "^3.1.1",
"node-fetch-commonjs": "^3.3.2",
"openapi-path-templating": "^1.5.0",
"openapi-path-templating": "^1.5.1",
"qs": "^6.10.2",
"traverse": "=0.6.8"
},
Expand Down
12 changes: 6 additions & 6 deletions src/execute/oas3/parameter-builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ export function path({ req, value, parameter, pathName }) {

if (value === undefined) return;

let resolvedPathname;

if (content) {
const effectiveMediaType = Object.keys(content)[0];

const resolvedPathname = resolvePathTemplate(
resolvedPathname = resolvePathTemplate(
pathName,
{ [name]: value },
{ encoder: (val) => encodeCharacters(serialize(val, effectiveMediaType)) }
);

req.url = req.url.replace(pathName, resolvedPathname);
} else {
const resolvedPathname = resolvePathTemplate(
resolvedPathname = resolvePathTemplate(
pathName,
{ [name]: value },
{
Expand All @@ -33,9 +33,9 @@ export function path({ req, value, parameter, pathName }) {
}),
}
);

req.url = req.url.replace(pathName, resolvedPathname);
}

req.url = req.url.replace(pathName, resolvedPathname);
}

export function query({ req, value, parameter }) {
Expand Down

0 comments on commit 0a64afb

Please sign in to comment.