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

Is there a schema available for the Alire Toml? #1755

Open
Joebeazelman opened this issue Sep 8, 2024 · 5 comments
Open

Is there a schema available for the Alire Toml? #1755

Joebeazelman opened this issue Sep 8, 2024 · 5 comments
Labels
type: documentation For non-code pending changes

Comments

@Joebeazelman
Copy link

I haven't been able to find a schema for Alire's Toml, which would make it a lot easier to work with. VSCode has the ability to suggest and autocomplete based on it.

@Fabien-Chouteau
Copy link
Member

That would be useful indeed. What format does VSCode use for the schema?

@mosteo mosteo added the type: documentation For non-code pending changes label Sep 9, 2024
@Joebeazelman
Copy link
Author

Joebeazelman commented Sep 10, 2024

There are two levels of TOML schemas: one for the configuration file format (JSON Schema, XML Schema), and another for the data represented in that format (JSON:API, WSDL). Unlike more established formats, the TOML standard specifies neither.

Since VSCode doesn't support TOML, its validation is left to third-party extensions. Even Better TOML, part of the Taplo tools and libraries, is the most popular and feature complete one, supporting not only validation, but also syntax coloring, and formatting.

Even Better TOML uses its own TOML data schema based on the JSON Schema draft 4 specification. Schemas can be published to the public catalog, JSON Schema Store. Documentation is quite sparse, but there's a few reference examples available on the schema store. To specify a schema for a TOML file, there are several methods, but the one involving the least configuration on the part of the client is by setting an Alire environment variable.

@Fabien-Chouteau
Copy link
Member

Thanks @Joebeazelman,

This looks very interesting. The main question at this point is whether or not we can generate the schema from Alire code.
Maintaining this by hand seems extremely error prone.

@mosteo
Copy link
Member

mosteo commented Sep 12, 2024

We generate a subset of the manifest programmatically, so maybe the schema generation could be hooked there.

@Joebeazelman
Copy link
Author

Joebeazelman commented Sep 12, 2024

Interesting. Do you think it's more advantageous for clients to source the schema directly from Alire or from the public JSON Schema Store? VSCode and Even Better TOML clients have the flexibility to source either, but others may not be as flexible. This would entail resubmition to the Schema Store whenever Alire is updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation For non-code pending changes
Projects
None yet
Development

No branches or pull requests

3 participants