Skip to content

Add Ion codec for kyo-schema#1659

Draft
hearnadam wants to merge 4 commits into
mainfrom
add-kyo-schema-ion
Draft

Add Ion codec for kyo-schema#1659
hearnadam wants to merge 4 commits into
mainfrom
add-kyo-schema-ion

Conversation

@hearnadam

Copy link
Copy Markdown
Collaborator

Summary

  • Adds Ion encode/decode entry points plus IonReader and IonWriter.
  • Supports schema-shaped Ion text: structs, lists, maps, blobs, typed nulls, comments, symbols as strings, timestamps, long strings, special floats, and annotations as metadata.
  • Vendors selected Apache-2.0 amazon-ion/ion-tests resources under kyo-schema shared test resources with provenance, license, and corpus coverage.
  • Documents that Ion annotations are accepted and validated as input syntax, but are not preserved by schema decoding or emitted by encoding.

Tests

  • sbt 'kyo-schema/testOnly kyo.IonTest kyo.IonCorpusTest'
  • sbt 'kyo-schema/test'

Notes

  • Ion.decode is a single-value schema decode API. Tests that use upstream Ion stream files assert selected root values explicitly rather than treating streams as schema lists.

hearnadam and others added 4 commits June 3, 2026 17:25
…oss-platform

The kyo-test migration removed the old per-module Test base and runs every shared
test on JVM, JS, and Native. Bring the Ion codec PR in line:

- IonTest and IonCorpusTest extend kyo.test.Test[Any].
- IonWriter.writeFloat formats through Ryu.RyuDouble (as JsonWriter already does)
  instead of java.lang.Double.toString, which renders 5.0 as "5" on Scala.js and
  broke encode parity across platforms.
- IonCorpusTest reads the vendored Amazon ion-tests corpus through kyo.Path rather
  than JVM classpath getResourceAsStream, which does not link on Scala.js/Native. It
  finds the repository root by walking Path.cwd ancestors to the directory holding
  build.sbt, so the suite runs on all three platforms. This adds a test-scoped
  dependency on kyo-core (where Path lives) and enables ModuleKind.CommonJSModule for
  kyo-schema's JS test linking, since kyo.Path's JS backend uses node:fs.
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.

2 participants