Skip to content

Commit

Permalink
fix(ls): fix path template parameter matching (#3601)
Browse files Browse the repository at this point in the history
No matches are now registered for template expressions
defined inside query parameters.

URLs with fragments are now supported, but no matches
are registered for template expressiones defined inside fragments.

Refs #3517
  • Loading branch information
char0n committed Jan 2, 2024
1 parent fb3f70a commit 7cf522d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
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 packages/apidom-ls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"@swagger-api/apidom-parser-adapter-yaml-1-2": "^0.89.0",
"@swagger-api/apidom-reference": "^0.89.0",
"@types/ramda": "~0.29.6",
"openapi-path-templating": "^1.3.0",
"openapi-path-templating": "^1.4.0",
"ramda": "~0.29.1",
"ramda-adjunct": "^4.1.1",
"vscode-languageserver-protocol": "^3.17.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1049,11 +1049,10 @@ export const standardLinterfunctions: FunctionItem[] = [
}
});

const allowedLocation = ['path', 'query'];
const pathTemplateResolveParams: { [key: string]: 'placeholder' } = {};

parameterElements.forEach((parameter) => {
if (allowedLocation.includes(toValue((parameter as ObjectElement).get('in')))) {
if (toValue((parameter as ObjectElement).get('in')) === 'path') {
pathTemplateResolveParams[toValue((parameter as ObjectElement).get('name'))] =
'placeholder';
}
Expand Down

0 comments on commit 7cf522d

Please sign in to comment.