JsonType

zio.blocks.schema.json.JsonType
See theJsonType companion object
sealed trait JsonType extends Json => Boolean

A sealed trait representing the type of a JSON value.

This is used by MergeStrategy to make decisions about recursion without needing access to the actual JSON values.

Each case provides two type members:

  • Type: The corresponding Json subtype (e.g., Json.Object)
  • Unwrap: The underlying Scala type of the value (e.g., Chunk[(String, Json)])

Attributes

Companion
object
Source
JsonType.scala
Graph
Supertypes
trait Json => Boolean
class Object
trait Matchable
class Any
Known subtypes
object Array
object Boolean
object Null
object Number
object Object
object String
Show all

Members list

Type members

Types

type Type <: Json

The corresponding Json subtype for this JSON type.

The corresponding Json subtype for this JSON type.

Attributes

Source
JsonType.scala
type Unwrap

The underlying Scala type of the value contained in this JSON type.

The underlying Scala type of the value contained in this JSON type.

Attributes

Source
JsonType.scala

Value members

Abstract methods

def typeIndex: Int

Returns the type index for ordering: Null=0, Boolean=1, Number=2, String=3, Array=4, Object=5

Returns the type index for ordering: Null=0, Boolean=1, Number=2, String=3, Array=4, Object=5

Attributes

Source
JsonType.scala

Concrete methods

override def apply(json: Json): Boolean

Returns true if the given JSON value is of this type.

Returns true if the given JSON value is of this type.

Attributes

Definition Classes
Function1
Source
JsonType.scala

Inherited methods

def andThen[A](g: Boolean => A): Json => A

Composes two instances of Function1 in a new Function1, with this function applied first.

Composes two instances of Function1 in a new Function1, with this function applied first.

Type parameters

A

the result type of function g

Value parameters

g

a function R => A

Attributes

Returns

a new function f such that f(x) == g(apply(x))

Inherited from:
Function1
Source
Function1.scala
def compose[A](g: A => Json): A => Boolean

Composes two instances of Function1 in a new Function1, with this function applied last.

Composes two instances of Function1 in a new Function1, with this function applied last.

Type parameters

A

the type to which function g can be applied

Value parameters

g

a function A => T1

Attributes

Returns

a new function f such that f(x) == apply(g(x))

Inherited from:
Function1
Source
Function1.scala
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Function1 -> Any
Inherited from:
Function1
Source
Function1.scala