An OpenAPI language server for LSP compatible code editors.
⚠️ This is beta software. Many features are still missing. See Features below.
I created this language server because I manually edit OpenAPI/Swagger files, and I needed a quick way to jump between schema definitions and references.
I use yaml-language-server for validation and completion, so these features are not a priority for me right now.
- Jump to definition
- Find references
- Code completion
- Diagnostics
- Hover
- Rename
- Document symbols
- Code actions
- YAML filetype support
- JSON filetype support
- VSCode extension
Download the latest release from GitHub releases.
go install github.com/armsnyder/openapi-language-server@latest
Assuming you are using Neovim and have the installed openapi-language-server binary in your PATH, you can use the following Lua code in your Neovim configuration:
vim.api.nvim_create_autocmd('FileType', {
pattern = 'yaml',
callback = function()
vim.lsp.start {
cmd = { 'openapi-language-server' },
filetypes = { 'yaml' },
root_dir = vim.fn.getcwd(),
}
end,
})
This is just a basic working example. You will probably want to further customize the configuration to your needs.