feat: update json schema.

This commit is contained in:
ya7010 2025-08-12 01:34:55 +09:00
parent 876c0d8eef
commit bf361a45fa
4 changed files with 14 additions and 5 deletions

View file

@ -4,6 +4,10 @@ use tombi_toml_version::TomlVersion;
#[serde(deny_unknown_fields)]
#[serde(rename_all = "kebab-case")]
#[cfg_attr(feature = "jsonschema", derive(schemars::JsonSchema))]
#[cfg_attr(feature = "jsonschema", schemars(extend("$id" = "tombi://json.tombi.dev/root-comment-directive.json")))]
pub struct RootCommentDirective {
/// # TOML version.
///
/// This directive specifies the TOML version of this document, with the highest priority.
pub toml_version: Option<TomlVersion>,
}

View file

@ -1,5 +1,6 @@
{
"$schema": "tombi://json.tombi.dev/api/json/catalog.json",
"$id": "tombi://json.tombi.dev/api/json/catalog.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"version": 1,
"schemas": [
{

View file

@ -1,9 +1,12 @@
{
"$schema": "tombi://json.tombi.dev/root-comment-directive.json",
"$id": "tombi://json.tombi.dev/root-comment-directive.json",
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "RootCommentDirective",
"type": "object",
"properties": {
"toml-version": {
"title": "TOML version.",
"description": "This directive specifies the TOML version of this document, with the highest priority.",
"anyOf": [
{
"$ref": "#/definitions/TomlVersion"
@ -19,7 +22,10 @@
"TomlVersion": {
"title": "TOML version.",
"type": "string",
"enum": ["v1.0.0", "v1.1.0-preview"]
"enum": [
"v1.0.0",
"v1.1.0-preview"
]
}
}
}

View file

@ -1,5 +1,3 @@
# tombi: toml-version = "v1.0.0"
[toolchain]
channel = "stable"
components = ["clippy", "rust-analyzer", "rustfmt"]