I would like to use nvim lsp to validate an OpenAPI file.
Here are the steps I've been following:
- I installed yaml-language-server, and made sure it was available in the PATH
- I downloaded the OpenAPI schema from here, and stored it in my filesystem.
- I modified my existing init.vim to include the following:
lspconfig.yamlls.setup {
on_attach = on_attach,
flags = {
debounce_text_changes = 150,
},
settings = {
yaml = {
schemas = {
{
fileMatch = { ".openapi.yaml" },
url = "file:///[...]/openapi.schema.yaml"
}
},
format = {
enable = true,
singleQuote = false,
bracketSpacing = true
},
validate = true,
completion = true
}
}
}
- I wrote a simple OpenAPI spec file, and opened it with nvim.
It seems that my nvim correctly hits the yaml-language-server to validate the yaml syntax, but it does not seem to validate against the schema.
One of the problem I have is that I don't have access to logs of nvim, or the yaml-language-server, to have some insight about what's going on.