Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-5318

Java RecordCodec not supporting "BsonDiscriminator"

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON, Codecs
    • Labels:
      None
    • Java Drivers

      Java Record supports for interface implementation.

      Let say i have interface A

      record B implements A

      record C implements A

      Let say i have some type of collection like this: List<A>

      This list permit me to add B and C types of objects.

      The problem is when you try to convert this list to BSON using RecordCodec

      It throws Not supporting exception for BsonDiscriminator.

      BsonDiscriminator supporting records is essential for this situation otherwise it is requiring to manually implement this solution...

      Full Explanation

            Assignee:
            Unassigned Unassigned
            Reporter:
            eliparchik@gmail.com Eli Partsi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: