Schema Document Directive
Same as Taplo, #:schema is used to specify the schema to use for the document.
However, Tombi only allows document comment directives at the beginning of the document, so you need to add a blank line after the directive.
Usage
HTTP/HTTPS URLs
#:schema https://example.com/my-schema.json
[config]
value = "example"Local File Paths
#:schema ./schemas/my-schema.json
[settings]
enabled = true🗒️Note
Although not defined by RFC 8089,
which specifies the file URI scheme,
Tombi allows the specification of . and .. in the hostname of the file:// file URI.
These hostname values are resolved as follows:
- If the file URI authority is
., Tombi treats it as the directory that contains the TOML file. - If the file URI authority is
.., Tombi treats it as the parent directory of the TOML file.
This allows you to specify local files in the following ways:
#:schema file://../../schemas/my-schema.json#/definitions/User
name = "Taro"
country = "Japan"