mirror of
https://github.com/tombi-toml/tombi.git
synced 2025-12-23 09:19:21 +00:00
feat: update json schema.
This commit is contained in:
parent
876c0d8eef
commit
bf361a45fa
4 changed files with 14 additions and 5 deletions
|
|
@ -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>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
# tombi: toml-version = "v1.0.0"
|
||||
|
||||
[toolchain]
|
||||
channel = "stable"
|
||||
components = ["clippy", "rust-analyzer", "rustfmt"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue