diff --git a/packages/apidom-ls/src/config/openapi/path-item/completion.ts b/packages/apidom-ls/src/config/openapi/path-item/completion.ts index 634854db6..c343e9272 100644 --- a/packages/apidom-ls/src/config/openapi/path-item/completion.ts +++ b/packages/apidom-ls/src/config/openapi/path-item/completion.ts @@ -239,6 +239,186 @@ const completion: ApidomCompletionItem[] = [ { namespace: 'openapi', version: '3.0.3' }, ], }, + // OpenAPI 3.1.x + { + label: '$ref', + insertText: '$ref', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'Allows for an external definition of this path item. The referenced structure MUST be in the format of a [Path Item Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#pathItemObject). In case a Path Item Object field appears both in the defined object and the referenced object, the behavior is undefined. See the rules for resolving [Relative References](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#relativeReferencesURI).', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'summary', + insertText: 'summary', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: 'An optional string summary, intended to apply to all operations in this path.', + }, + }, + { + label: 'description', + insertText: 'description', + kind: 14, + format: CompletionFormat.QUOTED, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + 'An optional string description, intended to apply to all operations in this path. [CommonMark syntax](https://spec.commonmark.org/) MAY be used for rich text representation.', + }, + }, + { + label: 'get', + insertText: 'get', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a GET operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'put', + insertText: 'put', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a PUT operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'post', + insertText: 'post', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a POST operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'delete', + insertText: 'delete', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a DELETE operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'options', + insertText: 'options', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a OPTIONS operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'head', + insertText: 'head', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a HEAD operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'patch', + insertText: 'patch', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a PATCH operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'trace', + insertText: 'trace', + kind: 14, + format: CompletionFormat.OBJECT, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + '[Operation Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operationObject)\n\\\n\\\nA definition of a TRACE operation on this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + 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 all operations in this path.', + }, + targetSpecs: [{ namespace: 'openapi', version: '3.1.0' }], + }, + { + label: 'parameters', + insertText: 'parameters', + kind: 14, + format: CompletionFormat.ARRAY, + type: CompletionType.PROPERTY, + insertTextFormat: 2, + documentation: { + kind: 'markdown', + value: + "[[Parameter](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 all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. 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' }], + }, ]; export default completion;