diff --git a/packages/apidom-ls/src/config/openapi/operation/completion.ts b/packages/apidom-ls/src/config/openapi/operation/completion.ts index 8af00d4efb..35c3909bf6 100644 --- a/packages/apidom-ls/src/config/openapi/operation/completion.ts +++ b/packages/apidom-ls/src/config/openapi/operation/completion.ts @@ -62,6 +62,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'externalDocs', + insertText: 'externalDocs', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[External Documentation](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#externalDocumentationObject)\n\\\n\\\nAdditional external documentation for this operation.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'operationId', insertText: 'operationId', @@ -94,6 +108,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'parameters', + insertText: 'parameters', + kind: 14, + format: CompletionFormat.ARRAY, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + "[[Parameter Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)]\n\\\n\\\nA list of parameters that are applicable for this operation. If a parameter is already defined at the [Path Item](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemParameters), the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterName) and [location](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterIn). The list can use the [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject) to link to parameters that are defined at the [OpenAPI Object's components/parameters](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#componentsParameters).", + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'requestBody', insertText: 'requestBody', @@ -113,6 +141,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'requestBody', + insertText: 'requestBody', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[[Request Body Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#requestBodyObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)]\n\\\n\\\nThe request body applicable for this operation. The requestBody is fully supported in HTTP methods where the HTTP 1.1 specification [RFC7231](https://tools.ietf.org/html/rfc7231#section-4.3.1) has explicitly defined semantics for request bodies. In other cases where the HTTP spec is vague (such as [GET](https://tools.ietf.org/html/rfc7231#section-4.3.1), [HEAD](https://tools.ietf.org/html/rfc7231#section-4.3.2) and [DELETE](https://tools.ietf.org/html/rfc7231#section-4.3.5)), `requestBody` is permitted but does not have well-defined semantics and SHOULD be avoided if possible.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'responses', insertText: 'responses', @@ -132,6 +174,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'responses', + insertText: 'responses', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Responses Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#responsesObject)\n\\\n\\\nThe list of possible responses as they are returned from executing this operation.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'callbacks', insertText: 'callbacks', @@ -151,6 +207,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'callbacks', + insertText: 'callbacks', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'Map[`string`, [Callback Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject) | [Reference Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#referenceObject)]]\n\\\n\\\nA map of possible out-of band callbacks related to the parent operation. The key is a unique identifier for the Callback Object. Each value in the map is a [Callback Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#callbackObject) that describes a request that may be initiated by the API provider and the expected responses.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'deprecated', insertText: 'deprecated', @@ -183,6 +253,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'security', + insertText: 'security', + kind: 14, + format: CompletionFormat.ARRAY, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[[Security Requirement Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject)]\n\\\n\\\nA declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. To make security optional, an empty security requirement (`{}`) can be included in the array. This definition overrides any declared top-level [`security`](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#oasSecurity). To remove a top-level security declaration, an empty array can be used.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, { label: 'servers', insertText: 'servers', @@ -202,6 +286,20 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + { + label: 'servers', + insertText: 'servers', + kind: 14, + format: CompletionFormat.ARRAY, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[[Server Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#serverObject)]\n\\\n\\\nAn alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, ]; export default completion;