Skip to content

feat(anchors): validate TOML schema VERSION in StellarTomlParser (#779) - #821

Open
ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/toml-version-validation-779
Open

feat(anchors): validate TOML schema VERSION in StellarTomlParser (#779)#821
ZacLou wants to merge 1 commit into
Stellar-split:mainfrom
ZacLou:feat/toml-version-validation-779

Conversation

@ZacLou

@ZacLou ZacLou commented Sep 5, 2026

Copy link
Copy Markdown

Adds VERSION field validation to StellarTomlParser so future schema-breaking changes are rejected instead of silently producing incorrect data.

Changes

  • New exported constant: SUPPORTED_TOML_VERSIONS = ["2.0", "2.1"]
  • _parse now checks parsed.VERSION immediately after successful TOML parsing
    • Supported versions: accepted normally
    • Unsupported versions: throws UnsupportedTomlVersionError with the encountered version and supported list
    • Missing VERSION: accepted for backwards compatibility
  • New error class: UnsupportedTomlVersionError with version property
  • Tests: test/stellarTomlParserVersion.test.ts covers supported version, unsupported version, missing VERSION, and error shape

Closes #779

…llar-split#779)

- Add SUPPORTED_TOML_VERSIONS exported constant (["2.0", "2.1"])
- Check VERSION field immediately after successful TOML parse
- Throw UnsupportedTomlVersionError with version and supported list on mismatch
- Accept documents with no VERSION field (backwards compatible)
- Add unit tests for supported, unsupported, missing, and error shape

Closes Stellar-split#779
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validate TOML schema version compatibility in StellarTomlParser

1 participant