Multi-focus counterpart to JsonPrism: walks the JSON to some array, then applies the focus update to every element. Two pieces: prefix: Array[PathStep] (root-to-array, walked once) and focus: JsonFocus[A] (per-element). The Leaf-vs-Fields split lives in focus. Compat alias JsonFieldsTraversal points back here.
Two tiers (Ior-bearing default + *Unsafe), same shape as JsonPrism.
Attributes
- Companion
- object
- Source
- JsonTraversal.scala
- Graph
-
- Supertypes
-
trait Dynamicclass Objecttrait Matchableclass Any
Members list
Value members
Concrete methods
.at(i) sugar — extend the suffix by an array index.
.field(_.x) sugar — extend the suffix by a named field.
.fields(_.a, _.b, ...) — focus a NamedTuple per element.
Read every focus. String input is parsed first; a prefix-walk miss (or non-array terminal) is Ior.Left(chain), per-element failures accumulate — elements that fail drop out of the Vector while their failures join the chain (Ior.Both).
Read every focus. String input is parsed first; a prefix-walk miss (or non-array terminal) is Ior.Left(chain), per-element failures accumulate — elements that fail drop out of the Vector while their failures join the chain (Ior.Both).
Attributes
- Source
- JsonTraversal.scala
Silent read — prefix miss yields Vector.empty; undecodable elements are dropped.
Silent read — prefix miss yields Vector.empty; undecodable elements are dropped.
Attributes
- Source
- JsonTraversal.scala
Dynamic field sugar — traversal.name lowers to traversal.field(_.name). Compile-time checked against A's case fields; codecs for the field type are summoned at the call site.
Dynamic field sugar — traversal.name lowers to traversal.field(_.name). Compile-time checked against A's case fields; codecs for the field type are summoned at the call site.
Attributes
- Source
- JsonTraversal.scala
Inherited methods
Decode each focus, apply f, re-encode in place. String input is parsed first; failures accumulate as Chain[JsonFailure], with the input Json preserved on the Ior.Both side.
Decode each focus, apply f, re-encode in place. String input is parsed first; failures accumulate as Chain[JsonFailure], with the input Json preserved on the Ior.Both side.
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala
Silent modify — any parse / navigation / decode failure passes the input through unchanged (an unparseable String becomes Json.Null first).
Silent modify — any parse / navigation / decode failure passes the input through unchanged (an unparseable String becomes Json.Null first).
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala
Replace each focus with the encoding of a. Same parse / failure-accumulation behaviour as modify.
Replace each focus with the encoding of a. Same parse / failure-accumulation behaviour as modify.
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala
Silent place — input pass-through on any failure.
Silent place — input pass-through on any failure.
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala
place from a foreign source: replace each focus with the encoding of f(c).
place from a foreign source: replace each focus with the encoding of f(c).
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala
Silent transfer — input pass-through on any failure.
Silent transfer — input pass-through on any failure.
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala
Rewrite the raw Json at each focus — no decode of the focus, so f sees (and must return) plain Json. Same parse / failure-accumulation behaviour as modify.
Rewrite the raw Json at each focus — no decode of the focus, so f sees (and must return) plain Json. Same parse / failure-accumulation behaviour as modify.
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala
Silent transform — input pass-through on any failure.
Silent transform — input pass-through on any failure.
Attributes
- Inherited from:
- JsonOpticOps (hidden)
- Source
- JsonOpticOps.scala