MergeStrategy

zio.blocks.schema.json.MergeStrategy
See theMergeStrategy companion trait
object MergeStrategy

Attributes

Companion
trait
Source
MergeStrategy.scala
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case object Auto extends MergeStrategy

Deep merge: recursively merge all objects and arrays. Objects merge by key, arrays merge by index (not concatenation). At leaves, right value wins.

Deep merge: recursively merge all objects and arrays. Objects merge by key, arrays merge by index (not concatenation). At leaves, right value wins.

Attributes

Source
MergeStrategy.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait (DynamicOptic, Json, Json) => Json
class Object
trait Matchable
class Any
Show all
Self type
Auto.type
case object Concat extends MergeStrategy

Concatenate arrays instead of merging by index. Objects are still merged by key recursively.

Concatenate arrays instead of merging by index. Objects are still merged by key recursively.

Attributes

Source
MergeStrategy.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait (DynamicOptic, Json, Json) => Json
class Object
trait Matchable
class Any
Show all
Self type
Concat.type
final case class Custom(f: (DynamicOptic, Json, Json) => Json, r: (DynamicOptic, JsonType) => Boolean = ...) extends MergeStrategy

Custom merge strategy with full control over recursion and merging.

Custom merge strategy with full control over recursion and merging.

Value parameters

f

A function that takes (path, left, right) and returns the merged JSON value

r

A function that determines whether to recurse into containers (default: always recurse)

Attributes

Source
MergeStrategy.scala
Supertypes
trait Serializable
trait Product
trait Equals
trait (DynamicOptic, Json, Json) => Json
class Object
trait Matchable
class Any
Show all
case object Replace extends MergeStrategy

Complete replacement: no merging at any level. Right value completely replaces left value.

Complete replacement: no merging at any level. Right value completely replaces left value.

Attributes

Source
MergeStrategy.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait (DynamicOptic, Json, Json) => Json
class Object
trait Matchable
class Any
Show all
Self type
Replace.type
case object Shallow extends MergeStrategy

Shallow merge: merge only at the root level, no recursion. Top-level object keys or array indices are merged, but nested containers are replaced (right wins).

Shallow merge: merge only at the root level, no recursion. Top-level object keys or array indices are merged, but nested containers are replaced (right wins).

Attributes

Source
MergeStrategy.scala
Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait (DynamicOptic, Json, Json) => Json
class Object
trait Matchable
class Any
Show all
Self type
Shallow.type

Inherited and Abstract types

type MirroredElemLabels <: Tuple

The names of the product elements.

The names of the product elements.

Attributes

Inherited from:
Mirror
Source
Mirror.scala
type MirroredLabel <: String

The name of the type.

The name of the type.

Attributes

Inherited from:
Mirror
Source
Mirror.scala