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

feat: Add json schema for config #534

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

EmilyGraceSeville7cf
Copy link

@EmilyGraceSeville7cf EmilyGraceSeville7cf commented Feb 6, 2024

  • hints for documented properties in README.md
  • links to README.md in hints
  • property format validation

@EmilyGraceSeville7cf EmilyGraceSeville7cf marked this pull request as draft February 6, 2024 13:55
@EmilyGraceSeville7cf EmilyGraceSeville7cf changed the title Add json schema for config feat: Add json schema for config Feb 6, 2024
@lars-berger
Copy link
Member

@EmilyGraceSeville7cf Wow, thanks for taking the time to do this 🙌 I've used JSON schemas for JSON files (eg. tsconfig, prettier etc), but have never used them for YAML before. How do I use these as an end user?

Also, would you happen to know whether SchemaStore accepts YAML configs like this one?

@EmilyGraceSeville7cf
Copy link
Author

EmilyGraceSeville7cf commented Feb 7, 2024

How do I use these as an end user?

There are plenty of options available for u in this case:

  • you can use some of CLI validators to manually validate your config for correctness (I recommend it to be used in GitHub actions for instance)
  • also you can install VS Code YAML Red Hat extension and refer to this schema like this: # yaml-language-server: $schema={{this_schema_url}}
  • but the best option to put this schema here, refer to it in SchemaStore repository and thus make VS Code automatically enable hints for GlazeWM configs in VS Code thanks to the extension mentioned above (I can do it)

Also, would you happen to know whether SchemaStore accepts YAML configs like this one?

JSON schema is suitable for validating YAML documents, if I correctly inferred what you meant. ;)

@EmilyGraceSeville7cf EmilyGraceSeville7cf marked this pull request as ready for review February 7, 2024 15:50
@EmilyGraceSeville7cf
Copy link
Author

EmilyGraceSeville7cf commented Feb 10, 2024

I finished my PR. I need a review, because I have some doubts about what properties should be marked as required (it's not documented).

P.S. I recommend make this schema autogenerated later in C#, but I can't help you here, I don't know this language.

@EmilyGraceSeville7cf
Copy link
Author

@lars-berger, can you review this PR?

@JustBarnt
Copy link

I noticed the schema has an error with workspaces/bind_to_monitor its marked as a boolean when it should be an integer?

@EmilyGraceSeville7cf
Copy link
Author

EmilyGraceSeville7cf commented May 18, 2024

@JustBarnt, I've fixed this problem. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants