How should we handle multiple Enumeration fields in Scala case classes?

How should we handle the (de)serialization of multiple Enumeration fields within case classes using the Scala driver? When trying to declare codecs for each Enumeration, only the Enumeration with the most recently registered codec seems to work. For instance:

case class Person(
                           _id: Option[Long],
                           name: String,                           
                           favoriteFood: FoodType.Value,
                           favoriteColor: ColorType.Value)

I then declare an Enumeration handler:

object EnumHandler {
    implicit object FoodTypeEnumHandler extends Codec[FoodType.Value] {
      override def encode(writer: BsonWriter, value: FoodType.Value, encoderContext: EncoderContext): Unit = {
        writer.writeString(value.toString)
      }

      override def getEncoderClass: Class[FoodType.Value] = classOf[FoodType.Value]

      override def decode(reader: BsonReader, decoderContext: DecoderContext): FoodType.Value = {
        val stringValue = reader.readString()
        FoodType.withName(stringValue)
      }
    }

    implicit object ColorTypeEnumHandler extends Codec[ColorType.Value] {
      override def encode(writer: BsonWriter, value: ColorType.Value, encoderContext: EncoderContext): Unit = {
        writer.writeString(value.toString)
      }

      override def getEncoderClass: Class[ColorType.Value] = classOf[ColorType.Value]

      override def decode(reader: BsonReader, decoderContext: DecoderContext): ColorType.Value = {
        val stringValue = reader.readString()
        ColorType.withName(stringValue)
      }
    }
  }

Next I create implicit Codecs for each:

implicit val foodTypeHandler: Codec[FoodType.Value] = EnumHandler.FoodTypeEnumHandler
implicit val colorTypeHandler: Codec[ColorType.Value] = EnumHandler.ColorTypeEnumHandler

And finally I register the codecs:

val codecRegistry = fromRegistries(fromCodecs(foodTypeHandler, colorTypeHandler), fromProviders(classOf[Person], DEFAULT_CODEC_REGISTRY))

When reading documents from the DB, the deserialization fails with the first registered codec and an error message such as “Exception. No value found for ‘Pizza’”. If I change the value of the document’s favoriteFood field to a known value in the ColorType Enumeration, the document will deserialize as expected.