mitch
05/12/2021, 12:48 PMsimon.vergauwen
05/12/2021, 12:53 PMJson
model) since that is the library I've been using mostly as an alternative.
What are the things, in particular, you like about Helios? I assume the type-safety in the `Encoder`/`Decoder` ?mitch
05/13/2021, 9:08 PMDecodeJson<out A>
typeclass, pretty much stolen from helios, to operate on Jackson's JsonNode. It's to be used for decoding classes like this. Jackson would've just happily bypass the validation.
@JsonDeserialize(using = EmailAdress.Companion.Deserializer)
class EmailAdress private constructor(val value: String) {
companion object {
fun fromString(value: String): Validated<Nel<Violation>, EmailAdress>
val decodeJson: DecodeJson<EmailAdress> = DecodeJson.string().flatMap { ... }
class Decoder : DecodeJackson(decodeJson)
}
}
simon.vergauwen
05/19/2021, 7:37 AM