JsonPatch

zio.blocks.schema.json.JsonPatch
See theJsonPatch companion object
final case class JsonPatch(ops: Chunk[JsonPatchOp])

An untyped patch that operates on Json values. Patches are composable and can be applied with different failure handling modes.

Value parameters

ops

The sequence of patch operations to apply

Attributes

Companion
object
Source
JsonPatch.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def ++(that: JsonPatch): JsonPatch

Composes two patches. The result applies this patch first, then that patch.

Composes two patches. The result applies this patch first, then that patch.

Value parameters

that

The patch to apply after this one

Attributes

Returns

A new patch that applies both patches in sequence

Source
JsonPatch.scala
def apply(value: Json, mode: PatchMode = ...): Either[SchemaError, Json]

Apply this patch to a Json value.

Apply this patch to a Json value.

Value parameters

mode

The patch mode controlling failure handling:

  • Strict: Fail on any precondition violation
  • Lenient: Skip operations that fail preconditions
  • Clobber: Overwrite/force on conflicts
value

The Json value to patch

Attributes

Returns

Either an error or the patched value

Source
JsonPatch.scala
def isEmpty: Boolean

Attributes

Source
JsonPatch.scala

Converts this JsonPatch to a DynamicPatch.

Converts this JsonPatch to a DynamicPatch.

This allows JsonPatch operations to be used with the generic patching infrastructure or serialized using DynamicPatch's schema.

Attributes

Returns

A DynamicPatch equivalent to this JsonPatch

Source
JsonPatch.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
Any
Source
JsonPatch.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala