Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to integrate Vector config schema with IDEs #22326

Closed
nomalord opened this issue Jan 30, 2025 · 7 comments · Fixed by #22329
Closed

Document how to integrate Vector config schema with IDEs #22326

nomalord opened this issue Jan 30, 2025 · 7 comments · Fixed by #22329
Labels
domain: external docs Anything related to Vector's external, public documentation type: enhancement A value-adding code change that enhances its existing functionality.

Comments

@nomalord
Copy link

I have started recently using vector. When creating different configurations, I noticed I had something missing, and that was auto generation in my IDE for the configuration.

Adding custom json-schemas into vs-code/jetbrains products allows for auto completion, type checking, built-in descriptions etc...

I believe adding a generated Json Schema for configurations as part of releases will significantly enhance the user experience.

How possible do you think this is?

@pront
Copy link
Member

pront commented Jan 30, 2025

Hi @nomalord, did you close this accidentally? It sounded like a great devex idea.

@pront
Copy link
Member

pront commented Jan 30, 2025

Feel free to reopen this or even better create an issue using this template: https://github.com/vectordotdev/vector/issues/new?template=feature.yml

@nomalord
Copy link
Author

nomalord commented Jan 30, 2025

I saw the generate-schema cli flag that generates a json-schema 😁

I just wish it would be better documented

@pront
Copy link
Member

pront commented Jan 30, 2025

I saw the generate-schema cli flag that generates a json-schema 😁

I just wish it would be better documented

Awesome! Can you share the steps you did to make it work for your IDE?
I will try to include it in the public docs.

@nomalord
Copy link
Author

Of course 👍
First run:

vector generate-schema > vector-schema.json

Move the json-schema file into a folder for schemas (I Personally use Documents in windows and setup a schemas folder)

In vscode, setup using the following guide:
https://www.ibm.com/docs/en/dbb/3.0?topic=ide-configuring-schema-validation-vscode#3-open-the-yamlschemas-property-in-settingsjson

In JetBrains setup using the following guide:
https://www.jetbrains.com/help/pycharm/yaml.html#get-properties-from-schema

I personally like setting up the file pattern like:

*.{name_of_schema}.yaml

So vector configurations will have file names: *.vector.yaml
That way any vector configurations I have will automatically get auto-completion (and other yaml files don't get affected)

@pront
Copy link
Member

pront commented Jan 30, 2025

TIL, thank you @nomalord. I will try it out locally on RustRover. And I will think of an appropriate place for this in the docs.

P.S. In the past, I have also seen some VRL plugins for Vim. We also have a https://playground.vrl.dev/ that does syntax highlighting for VRL. Things like this should go under the same umbrella in the docs.

@nomalord
Copy link
Author

I will reopen this under the guise of a documentation request :)

I don't really know how to add tags so i hope you will help me with that 😊

@nomalord nomalord reopened this Jan 30, 2025
@pront pront added the domain: external docs Anything related to Vector's external, public documentation label Jan 30, 2025
@pront pront changed the title Json Schema for vector configurations Document how to integrate Vector config schema with IDEs Jan 30, 2025
@pront pront added the type: enhancement A value-adding code change that enhances its existing functionality. label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: external docs Anything related to Vector's external, public documentation type: enhancement A value-adding code change that enhances its existing functionality.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants