jsoniter-scala icon indicating copy to clipboard operation
jsoniter-scala copied to clipboard

Provide codec for standard class Duration

Open DavidPerezIngeniero opened this issue 1 year ago • 2 comments

When trying:

case class ConfiguracionCola(
                              nombre: String,
                              maxWorkers: Int,
                              jobTimeout: Duration,
                              observaciones: String,
                              prioritaria: Boolean,
                              grupo: String,
                              httpTimeout: Duration,
                              httpTtl: Duration,
                              httpMaxReintentos: Int
                            )

object ConfiguracionCola:
   given JsonValueCodec[ConfiguracionCola:] = make

I receive this strange error message:

Local child symbols are not supported, please consider change 'scala.concurrent.duration.Duration.Infinite' or 
implement a custom implicitly accessible codec

For me, the error message is not explanatory enough. Should I write a custom serializer for Durations?

DavidPerezIngeniero avatar Oct 14 '24 11:10 DavidPerezIngeniero