yaml-language-server
yaml-language-server copied to clipboard
Command Line API/Option
Summary
Relevant information
@JPinkney @joshuawilson does this tool have an option or script to consume and validate a *.yaml
against a json schema
on the command line? For example
$ yaml-language-server /path/to/file.yaml /path/to/schema.json
some output indicating whether file.yaml is valid based on schema.json
We don't currently have a cli but if someone wanted to build one it would be pretty easy. You could create a new language service like what's done here: https://github.com/redhat-developer/yaml-language-server/blob/04bfdccaada7724469c76e3319a26d0a4b096de6/src/yamlServerInit.ts#L61 and then run validation against the inputs that are provided to the cli
@JPinkney thank you. In that case may dedicate dev time for implementing a cli feature.
I've been using https://github.com/InoUno/yaml-ls-check - which uses yaml-language-server under the hood - which is great and fits this need exactly :clap: