Add TOML parser and schema validator#7
Merged
heshanpadmasiri merged 8 commits intoballerina-platform:mainfrom Nov 17, 2025
Merged
Add TOML parser and schema validator#7heshanpadmasiri merged 8 commits intoballerina-platform:mainfrom
heshanpadmasiri merged 8 commits intoballerina-platform:mainfrom
Conversation
928173d to
8517726
Compare
heshanpadmasiri
approved these changes
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new Go TOML parsing library with schema validation support, comprehensive diagnostics, and an extensive test suite. The implementation leverages third-party libraries for TOML parsing and JSON schema validation, and provides user-friendly APIs for reading, querying, and validating TOML files.
Core TOML parsing and querying functionality:
Tomlstruct and related types intomlparser/toml.go, supporting reading TOML from files, streams, and strings, as well as querying values by dotted keys, extracting tables and arrays, and converting TOML data to Go structs. Diagnostics are recorded for parsing and mapping errors.Schema validation support:
Schemainterface and implementation intomlparser/schema.gousing thejsonschema/v6library, allowing validation of TOML data against JSON schemas loaded from files, strings, or file handles.Validatorinterface and implementation intomlparser/validator.goto validate TOML documents against schemas and append diagnostics on validation errors.Dependency management:
go.modto add dependencies ongithub.com/BurntSushi/tomlfor TOML parsing andgithub.com/santhosh-tekuri/jsonschema/v6for schema validation.Testing and sample data:
tomlparser/toml_test.gocovering parsing, querying, diagnostics, and schema validation scenarios.testdatadirectory, including valid, invalid, and missing-required-field examples. [1] [2] [3] [4] [5] [6]