From 5c4b48c27570dce969bd25eac55fbc29629d0480 Mon Sep 17 00:00:00 2001 From: Timothy Lai Date: Tue, 25 Oct 2022 14:50:52 -0700 Subject: [PATCH] feat(ls): provide OpenAPI 3.1.0 completion for Server Variable object --- .../openapi/server-variable/completion.ts | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/packages/apidom-ls/src/config/openapi/server-variable/completion.ts b/packages/apidom-ls/src/config/openapi/server-variable/completion.ts index ede4217387..744fc483ac 100644 --- a/packages/apidom-ls/src/config/openapi/server-variable/completion.ts +++ b/packages/apidom-ls/src/config/openapi/server-variable/completion.ts @@ -24,6 +24,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'enum', + insertText: 'enum', + kind: 14, + format: CompletionFormat.ARRAY, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'An enumeration of string values to be used if the substitution options are from a limited set. The array MUST NOT be empty.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'default', insertText: 'default', @@ -43,6 +57,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'default', + insertText: 'default', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + "**REQUIRED.** The default value to use for substitution, which SHALL be sent if an alternate value is *not* supplied. Note this behavior is different than the [Schema Object's](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schemaObject) treatment of default values, because in those cases parameter values are optional.If the [`enum`](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverVariableEnum) is defined, the value MUST exist in the enum's values.", + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'description', insertText: 'description',