JsoniterPrismMacro
dev.constructive.eo.jsoniter.JsoniterPrismMacro
object JsoniterPrismMacro
Macros backing the JsoniterPath builder — .field(_.fieldName), selectDynamic, at(i) and each — for every eo-jsoniter optic: the whole-array JsoniterPrism / JsoniterTraversal and their in-place faces. Extracts the field name from the selector AST (same pattern as eo-circe's JsonPrismMacro) and emits a widenField / widenIndex / toTraversal call on the builder, which builds the next optic of the builder's own kind (P, or T for .each). The single divergence from the circe macro: one JsonValueCodec[B] summon instead of the Encoder[B] / Decoder[B] pair.
val streetP: JsoniterPrism[String] =
JsoniterPrism[Person].field(_.address).field(_.street)
val streetIn: JsoniterInPlacePrism[String] =
JsoniterPrism.inPlace[Person].field(_.address).field(_.street)
Attributes
- Source
- JsoniterPrismMacro.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
JsoniterPrismMacro.type
Members list
In this article