The UUIDSerializer's deserializer will fail with a ClassCastException when the UUID is embedded in a list (e.g., val foo: Collection<@Contextual UUID> = emptyList()). The decoder in this example is a ListDecoder rather than the expected BsonFlexibleDecoder triggering the exception. Both, however, are FlexibleDecoder objects and the reader field is declared there. Updated the cast to this parent type, resolving the issue. The existing tests pass with this change.
The
UUIDSerializer
's deserializer will fail with aClassCastException
when the UUID is embedded in a list (e.g.,val foo: Collection<@Contextual UUID> = emptyList()
). The decoder in this example is aListDecoder
rather than the expectedBsonFlexibleDecoder
triggering the exception. Both, however, areFlexibleDecoder
objects and thereader
field is declared there. Updated the cast to this parent type, resolving the issue. The existing tests pass with this change.If you need more info, please let me know.