Skip to content

feat(xdr): define a versioned JSON schema for decoded values - #138

Merged
Ayinkx01 merged 1 commit into
StellarFoundry:mainfrom
olatechy0:feat/versioned-xdr-schema
Oct 28, 2026
Merged

Ayinkx01 merged 1 commit into
StellarFoundry:mainfrom
olatechy0:feat/versioned-xdr-schema

Conversation

@olatechy0

@olatechy0 olatechy0 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a versioned JSON schema for decoded XDR values, replacing the previously unstable serde-shaped output.

  • Every scval, envelope, and event document now carries schema_version: "1.0", kind, and value.
  • Adds the global --raw flag (and DecodeOptions { include_raw: true }) to echo the canonical base64 input as raw_xdr. It is off by default.
  • Documents the schema, XDR-JSON payload rules, versioning policy, and migration path in docs/XDR.md and docs/SCVAL.md.
  • Adds golden snapshot tests for all three kinds plus structural schema validation tests and CLI coverage.
  • Keeps existing kind/value fields, so the change is additive for consumers that ignore unknown fields.

Verification

Ran the project gate locally:

cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all

Manual check:

$ stellar-foundry --format json scval AAAAAwAAACo=
{"kind":"scval","schema_version":"1.0","value":{"u32":42}}
$ stellar-foundry --format json --raw scval AAAAAwAAACo=
{"kind":"scval","raw_xdr":"AAAAAwAAACo=","schema_version":"1.0","value":{"u32":42}}

Closes #12

@olatechy0
olatechy0 requested a review from Ayinkx01 as a code owner October 28, 2026 14:29
@Ayinkx01
Ayinkx01 merged commit e6f4ec2 into StellarFoundry:main Oct 28, 2026
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.

feat(xdr): define a versioned JSON schema for decoded values

2 participants