zio.blocks.schema.toon

Members list

Type members

Classlikes

sealed trait ArrayFormat

Specifies how arrays should be encoded in TOON format.

Specifies how arrays should be encoded in TOON format.

Attributes

Companion
object
Source
ArrayFormat.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Auto
object Inline
object List
object Tabular
object ArrayFormat

Attributes

Companion
trait
Source
ArrayFormat.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class ArrayHeader(key: String, length: Int, fields: Array[String], delimiter: Delimiter)

Attributes

Source
ToonReader.scala
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case object BuildInfo

This object was generated by sbt-buildinfo.

This object was generated by sbt-buildinfo.

Attributes

Source
BuildInfo.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
BuildInfo.type
object Delimiter

Attributes

Companion
class
Source
Delimiter.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Delimiter.type
sealed abstract class Delimiter(val char: Char)

Delimiter used to separate values in TOON inline arrays.

Delimiter used to separate values in TOON inline arrays.

Value parameters

char

the delimiter character

Attributes

Companion
object
Source
Delimiter.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Comma
object None
object Pipe
object Tab
sealed trait DiscriminatorKind

Represents the strategy for specifying the discriminator used in a TOON schema for distinguishing between different subtypes of a sealed hierarchy.

Represents the strategy for specifying the discriminator used in a TOON schema for distinguishing between different subtypes of a sealed hierarchy.

Implementations of this trait define how the discriminator is represented in the serialized TOON, if any.

The possible discriminator kinds include:

  • Field with adding a custom field named as specified in the name parameter that contains a value of the subtype discriminator, e.g. type: Person followed by the record fields for case class Person(...) extends SealedTrait
  • Key, where the discriminator is represented as a TOON key with wrapping of the encoded value in a nested record, e.g. Person: followed by indented fields for case class Person(...) extends SealedTrait.
  • None, where no discriminator is used, meaning subtype differentiation is handled by sequential attempts to parse all possible subtypes, starting from the first subtype, until a successful parse is found, or an error is thrown if none of the subtypes can be parsed from the input.

Attributes

Companion
object
Source
DiscriminatorKind.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Field
object Key
object None

Attributes

Companion
trait
Source
DiscriminatorKind.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
object KeyFolding

Attributes

Companion
class
Source
KeyFolding.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
KeyFolding.type
sealed abstract class KeyFolding

Strategy for folding nested keys in TOON output.

Strategy for folding nested keys in TOON output.

Attributes

Companion
object
Source
KeyFolding.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Off
object Safe
object PathExpansion

Attributes

Companion
class
Source
PathExpansion.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed abstract class PathExpansion

Strategy for expanding dot-separated paths in TOON input.

Strategy for expanding dot-separated paths in TOON input.

Attributes

Companion
object
Source
PathExpansion.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Off
object Safe
class ReaderConfig extends Serializable

Configuration for zio.blocks.schema.toon.ToonReader that contains params for parsing TOON input and for tuning reader behavior.

Configuration for zio.blocks.schema.toon.ToonReader that contains params for parsing TOON input and for tuning reader behavior.

All configuration params are already initialized to default values, but in some cases they should be altered:

  • change the expected indentation step (default 2 spaces per level)
  • change the expected delimiter for inline arrays (comma, tab, or pipe)
  • disable strict mode to allow lenient parsing of malformed input
  • enable path expansion to parse dot-separated keys as nested records
  • set discriminator field for DynamicValue variant decoding

Value parameters

delimiter

the expected delimiter character for inline arrays (default: Comma)

discriminatorField

optional field name to use as discriminator for DynamicValue variants (default: None, which decodes as Record)

expandPaths

strategy for expanding dot-separated paths (default: Off)

indent

the expected number of spaces per indentation level (default: 2)

strict

whether to enforce strict TOON parsing (default: true)

Attributes

Companion
object
Source
ReaderConfig.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object ReaderConfig
object ReaderConfig extends ReaderConfig

Attributes

Companion
class
Source
ReaderConfig.scala
Supertypes
class ReaderConfig
trait Serializable
class Object
trait Matchable
class Any
Self type
object ToonCodec

Attributes

Companion
class
Source
ToonCodec.scala
Supertypes
class Object
trait Matchable
class Any
Self type
ToonCodec.type
abstract class ToonCodec[A] extends BinaryCodec[A]

Abstract class for encoding and decoding values of type A to and from TOON formats. Encapsulates logic to map TOON representations into native type structures and vice versa, handling serialization and deserialization as per TOON encoding standards using UTF-8 character set.

Abstract class for encoding and decoding values of type A to and from TOON formats. Encapsulates logic to map TOON representations into native type structures and vice versa, handling serialization and deserialization as per TOON encoding standards using UTF-8 character set.

This class requires an implementation for two core operations: decoding a value of type A from a TOON representation and encoding a value of type A into a TOON representation.

Attributes

Companion
object
Source
ToonCodec.scala
Supertypes
class BinaryCodec[A]
class Object
trait Matchable
class Any

Attributes

Companion
class
Source
ToonCodecDeriver.scala
Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Companion
object
Source
ToonCodecDeriver.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Source
ToonFormat.scala
Supertypes
trait Format
class Object
trait Matchable
class Any
Self type
ToonFormat.type
object ToonReader

Attributes

Companion
class
Source
ToonReader.scala
Supertypes
class Object
trait Matchable
class Any
Self type
ToonReader.type
final class ToonReader

A reader to parse TOON input iteratively.

A reader to parse TOON input iteratively.

Value parameters

delimiter

the expected delimiter for inline arrays

discriminatorField

optional field name to use as discriminator for DynamicValue variants

expandPaths

strategy for expanding dot-separated paths

indentSize

the expected number of spaces per indentation level

strict

whether to enforce strict TOON parsing

Attributes

Companion
object
Source
ToonReader.scala
Supertypes
class Object
trait Matchable
class Any
final class ToonWriter

A writer for iterative serialization of TOON keys and values.

A writer for iterative serialization of TOON keys and values.

Value parameters

buf

an internal buffer for writing TOON data

count

the current position in the internal buffer

delimiter

the delimiter for inline arrays

discriminatorField

optional field name to use as discriminator for DynamicValue variants

flattenDepth

maximum depth for key folding

indentSize

the number of spaces per indentation level

keyFolding

strategy for folding nested keys

Attributes

Companion
object
Source
ToonWriter.scala
Supertypes
class Object
trait Matchable
class Any
object ToonWriter

Attributes

Companion
class
Source
ToonWriter.scala
Supertypes
class Object
trait Matchable
class Any
Self type
ToonWriter.type
class WriterConfig extends Serializable

Configuration for zio.blocks.schema.toon.ToonWriter that contains params for formatting of output TOON and for tuning serialization behavior.

Configuration for zio.blocks.schema.toon.ToonWriter that contains params for formatting of output TOON and for tuning serialization behavior.

All configuration params are already initialized to default values, but in some cases they should be altered:

  • change the indentation step (default 2 spaces per level)
  • change the delimiter for inline arrays (comma, tab, or pipe)
  • enable key folding to produce more compact output for shallow structures
  • adjust flatten depth to control when nested records use indentation
  • set discriminator field for DynamicValue variant encoding

Value parameters

delimiter

the delimiter character for inline arrays (default: Comma)

discriminatorField

optional field name to use as discriminator for DynamicValue variants (default: None, which uses key-style encoding)

flattenDepth

maximum depth at which to flatten nested structures (default: Int.MaxValue)

indent

the number of spaces per indentation level (default: 2)

keyFolding

strategy for folding nested keys (default: Off)

Attributes

Companion
object
Source
WriterConfig.scala
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object WriterConfig
object WriterConfig extends WriterConfig

Attributes

Companion
class
Source
WriterConfig.scala
Supertypes
class WriterConfig
trait Serializable
class Object
trait Matchable
class Any
Self type