Gson with Scala causes StackOverflow for Enumerations
问题 I have an enum defined in Scala class as follows // define compression types as enumerator object CompressionType extends Enumeration { type CompressionType = Value val None, Gzip, Snappy, Lz4, Zstd = Value } and I have class that I want to Serialize in JSON case class ProducerConfig(batchNumMessages : Int, lingerMs : Int, messageSize : Int, topic: String, compressionType: CompressionType.Value ) That class includes the Enum object. It seems that using GSON to serialize causes StackOverflow