GitPedia

Toml schema

From brunoborges·Updated June 1, 2026·View on GitHub·

TOML Schema is a TOML-based schema language for describing and validating the structure, names, and value types of TOML configuration files. The project is written primarily in Java, distributed under the MIT License license, first published in 2020. Key topics include: toml, toml-language, toml-parser, toml-parsing, toml-validation.

Latest release: v1.0.0-rc.2
May 28, 2026View Changelog →

TOML Schema

Reference implementations
License
TOML 1.0
Java 25
Go 1.23
Rust 1.75

TOML Schema is a TOML-based schema language for describing and validating the structure, names, and value types of TOML configuration files.

A TOML Schema document is itself a valid TOML document. Validators can use it to catch misconfiguration before production and tooling can use it for editor validation, completion, and hints.

Documentation

  • Specification - the TOML Schema language, validation semantics, file extension, MIME type, and TOML schema-reference metadata.
  • ABNF grammar - a compact grammar for the TOML Schema vocabulary and document shape, layered on top of TOML 1.0.
  • Self-schema - a TOML Schema document for TOML Schema documents.
  • Example schema and example TOML document - a worked example used by the reference implementation tests.
  • Reference implementations - implementation status, Java CLI/library usage, and conformance expectations.

Quick example

TOML document:

toml
title = "TOML Example" [database] enabled = true ports = [8000, 8001, 8002]

TOML Schema document:

toml
[toml-schema] version = "1.0.0" [elements.title] type = "string" [elements.database] type = "table" [elements.database.enabled] type = "boolean" [elements.database.ports] type = "array" arraytype = "integer"

Reference implementations

Java, Go, and Rust reference implementations live under reference-implementations/. See Reference implementations for implementation status, build/test commands, CLI usage, schema extraction, and conformance expectations.

Schema reference from TOML

A TOML document can point to a schema with reserved metadata:

toml
[toml-schema] version = "1.0.0" location = "config.tosd"

See SPEC.md for the full behavior.

There is an ongoing effort to bring schema support for TOML under toml-lang/toml#792. This proposal intentionally focuses on a smaller TOML-native schema language.

Contributors

Thanks to my friends!

License

TOML Schema is licensed under the MIT License.

Contributors

Showing top 3 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from brunoborges/toml-schema via the GitHub API.Last fetched: 6/14/2026