plokhotnyuk / jsoniter-scala

Scala macros for compile-time generation of safe and ultra-fast JSON codecs + circe booster
MIT License
744 stars 99 forks source link

Handle union types #1183

Open DavidPerezIngeniero opened 2 months ago

DavidPerezIngeniero commented 2 months ago

It would be deisrable to handle union types, at least in some simple scenarios, like sealed class hierarchies are supported.

Some examples:

Seq[Int|String|Date]
Option[Int|String|Date|Double]
String | Boolean | MyCaseClass

I know that full support to union types is complicated.

A custom codec could be written, but it would be interesting that jsoniter could handle this automatically.

DavidPerezIngeniero commented 2 months ago

Related info: https://www.reddit.com/r/scala/comments/x6vnbo/is_there_a_json_parsing_library_that_supports/