This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Udash Option JSON codec for (de)serializing it this way: | |
* Some(x) will be serialized as x. | |
* None will be serialized as null. | |
*/ | |
implicit def optionCodec[T: GenCodec]: GenCodec[Option[T]] = | |
create[Option[T]]( | |
i => i.inputType match { | |
case InputType.Null => | |
i.readNull() |