Skip to content

Commit ae9ec4f

Browse files
authored
feat(ls): OpenAPI 3.1.0 lint rules for Server object (#2149)
1 parent 20a09d5 commit ae9ec4f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

packages/apidom-ls/src/config/openapi/server/completion.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ const completion: ApidomCompletionItem[] = [
5050
{ namespace: 'openapi', version: '3.0.3' },
5151
],
5252
},
53+
{
54+
label: 'variables',
55+
insertText: 'variables',
56+
kind: 14,
57+
format: CompletionFormat.OBJECT,
58+
type: CompletionType.PROPERTY,
59+
insertTextFormat: 2,
60+
documentation: {
61+
kind: 'markdown',
62+
value:
63+
"Map[`string`, [Server Variable Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#serverVariableObject)]\n\\\n\\\nA map between a variable name and its value. The value is used for substitution in the server's URL template.",
64+
},
65+
targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }],
66+
},
5367
];
5468

5569
export default completion;

packages/apidom-ls/src/config/openapi/server/lint/variables--values-type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { LinterMeta } from '../../../../apidom-language-types';
44
const variablesValuesTypeLint: LinterMeta = {
55
code: ApilintCodes.OPENAPI3_O_SERVER_FIELD_VARIABLES_VALUES_TYPE,
66
source: 'apilint',
7-
message: '"varialbes" members must be Server Variable Object',
7+
message: '"variables" members must be Server Variable Object',
88
severity: 1,
99
linterFunction: 'apilintChildrenOfElementsOrClasses',
1010
linterParams: [['serverVariable']],

0 commit comments

Comments
 (0)